Author Topic: Java multiple second freeze after typing ( after get function  (Read 3406 times)

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Java multiple second freeze after typing ( after get function
« on: December 17, 2019, 06:17:06 PM »
Look for analyzer-openparen-freeze.7z on support.

See the README file to reproduce.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: Java multiple second freeze after typing ( after get function
« Reply #1 on: December 18, 2019, 04:48:30 PM »
I can't seem to reproduce this. Maybe this is being caused by gcc.vtg but I don't know. I also tried to reproduce this on Linux since I've got gcc there and created a tag file for it.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Java multiple second freeze after typing ( after get function
« Reply #2 on: December 18, 2019, 04:52:29 PM »
It is strange that you are mentioning gcc, because this is a Java program.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Java multiple second freeze after typing ( after get function
« Reply #3 on: December 18, 2019, 04:54:20 PM »
BTW: I am using JDK 11.0.5 from Oracle. And I am having this issue on Windows, not Linux.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: Java multiple second freeze after typing ( after get function
« Reply #4 on: December 18, 2019, 04:55:13 PM »
Oops. I think I've been working too much. I'll autotag Java.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: Java multiple second freeze after typing ( after get function
« Reply #5 on: December 18, 2019, 09:15:45 PM »
Typing '.' works quite fast for me (always <.5 seconds) and I'm running in a VM with a debug build of SlickEdit. However, typing '(' takes 3 seconds . With a release build on a faster machine, it takes 1-2 seconds to type '('. Not great. If you don't have a SSD, I would expect these times to be much slower than what I'm seeing.

Turn off Java>Context Tagging> "Auto-list compatible parameters" to make it faster.
Turn off Java>Context Tagging> "Show comments" to make it faster.

I think fetching the comments is slow in this case due to the fact that the comment is in "src.zip" which is huge. You can always type "Alt+Comma" when you want to see the comment.

If you turn off Java>Context Tagging> "Auto display parameter information", you won't be waiting for anything. However, it's a sledge hammer approach.

I'm surprised that just displaying the parameter argument information takes so long since listing the members is quite fast.



rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Java multiple second freeze after typing ( after get function
« Reply #6 on: December 18, 2019, 09:48:46 PM »
Thanks for the investigation and info Clark! Anything SE could change internally with those options checked to make it faster would be very appeciated!

I like to setup my configuration via scripting instead of checking boxes and then possibly forgetting I did that someday.

How to add into a macro to do each of the 3 below?

Turn off Java>Context Tagging> "Auto-list compatible parameters"

Turn off Java>Context Tagging> "Show comments"

Java>Context Tagging> "Auto display parameter information"

LBCEi

  • Senior Community Member
  • Posts: 261
  • Hero Points: 21
Re: Java multiple second freeze after typing ( after get function
« Reply #7 on: December 19, 2019, 12:55:43 AM »
Although I don't currently do this, I like rowbearto's idea about scripting config deltas. 

I know that it is possible to export a delta (or maybe it is a complete dump, I don't remember) for keybindings.

It might be nice to be able to create (via a similar export feature) a script that would recreate all deltas between a default config and the current config.

Come to think of it, SE must be doing essentially this process during version upgrades (under the covers).

Thoughts?

Sorry for going off topic here.  Let me know if I should start a new thread for this.

Thanks

Dennis

  • Senior Community Member
  • Posts: 3954
  • Hero Points: 515
Re: Java multiple second freeze after typing ( after get function
« Reply #8 on: December 19, 2019, 01:09:24 AM »
I am attaching an experimental hot fix for this problem.  Let me know if it helps.

Note, because of the nature of how the cumulative hot fixes are loaded, this fix might be kind of a one-off.  You can load it, but it might only be effective for your current session.

If it works, it will be part of the next cumulative hot fix for 24.0.0.
« Last Edit: December 19, 2019, 01:15:37 AM by Dennis »

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: Java multiple second freeze after typing ( after get function
« Reply #9 on: December 19, 2019, 01:51:46 AM »
Although I don't currently do this, I like rowbearto's idea about scripting config deltas. 

I know that it is possible to export a delta (or maybe it is a complete dump, I don't remember) for keybindings.

It might be nice to be able to create (via a similar export feature) a script that would recreate all deltas between a default config and the current config.

Come to think of it, SE must be doing essentially this process during version upgrades (under the covers).

Thoughts?

Sorry for going off topic here.  Let me know if I should start a new thread for this.

Thanks

Most options are deltas stored in user.cfg.xml. What we could use is a macro for applying the profile settings in a .cfg.xml file. Should be pretty easy to write. We are already doing something very similar when importing some settings. There are some user.cfg.xml settings that you wouldn't want to apply though (tag files--don't want these for sure, maybe workspace settings, maybe single file projects). Things that references external files are probably not a good idea to re-apply since you are likely to re-apply your settings on a different machine/config directory.

I rarely use the import/export feature in SlickEdit. It is a very easy system for users though. I just save off my user.cfg.xml. Then when I create a new config, I just copy that in. I do have an add on macro I need but I'm using an undocumented plugin system for that. It ends up being an extra invocation argument. Hopefully, some day that plugin system will be fully exposed. I could install the plugin in my config, but that would be an extra step. Instead I invoke SlickEdit via a script and just point SlickEdit to my local plugins.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Java multiple second freeze after typing ( after get function
« Reply #10 on: December 19, 2019, 02:24:19 AM »
Dennis: Will try the hotfix and let you know.

Clark/Dennis/SlickTeam: For scripting these checkboxes, let me know if below code is correct if so chose to do it:

Code: [Select]
#include "slick.sh"
#require "se/lang/api/LanguageSettings.e"
using se.lang.api.LanguageSettings;

defmain()
{
   // Per language setting.
   f := LanguageSettings.getCodehelpFlags('java');

   // Java>Context Tagging> "Auto-list compatible parameters" / ctlautolistparams
   f &= ~VSCODEHELPFLAG_AUTO_LIST_PARAMS;

   // Java>Context Tagging> "Show comments" / ctldispfunctioncomment
   f &= ~VSCODEHELPFLAG_DISPLAY_FUNCTION_COMMENTS;

   // Java>Context Tagging> "Auto display parameter information" / ctlautofunctionhelp
   f &= ~VSCODEHELPFLAG_AUTO_FUNCTION_HELP;

   LanguageSettings.setCodehelpFlags('java', f);
}
« Last Edit: December 19, 2019, 02:57:10 AM by rowbearto »

LBCEi

  • Senior Community Member
  • Posts: 261
  • Hero Points: 21
Re: Java multiple second freeze after typing ( after get function
« Reply #11 on: December 19, 2019, 02:32:32 AM »
Thanks for the response, Clark

As I said, I don't currently do this (scripting config deltas) but rowbearto's comment kind of sparked a curiosity for me.

One use case I can think of is sharing settings with a colleague, especially as a starting point for introducing a new user to SE with everything set up so that things work the same for them as for me.  I suspect that sharing the user.cfg.xml might not be the answer for that scenario.  I regret to say that I've not yet managed to create an SE convert so this hasn't been an issue.  Still trying (gently).

SE version updates (for the most part) have been pretty seamless for me over the years so I haven't needed the export/import feature much myself, either. 

Again, sorry to butt in on this thread.  It just got me thinking and wondering.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Java multiple second freeze after typing ( after get function
« Reply #12 on: December 19, 2019, 02:48:20 AM »
Dennis: Took a look at your hotfix but did not apply it yet.

Your hotfix seems to just apply a timeout. But what if really do want to see the code help and not have it take so long?

Would it make sense to offer an option to have the src.zip unzipped into the tagfiles directory so that unzipping this large file is not necessary every time a '(' is pressed? Then if SE used this unzipped version instead of the src.zip, one would be able to see the comments/code help very quickly and not run up against the timeout and not see it?

UPDATE: When I unzip the src.zip, it takes up 183MB (or 216MB "on disk"). I'd be willing to pay for this disk space utilization in order to get a faster code help.
« Last Edit: December 19, 2019, 03:15:59 AM by rowbearto »

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: Java multiple second freeze after typing ( after get function
« Reply #13 on: December 19, 2019, 03:12:57 AM »
SlickEdit is most likely spending most of the time caching the directory entries in src.zip. There are a ton of files. SlickEdit doesn't load the entire src.zip file. It just loads the directory table, seeks to the one file, and read that one entire file. Unzipping would help the performances for sure.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Java multiple second freeze after typing ( after get function
« Reply #14 on: December 19, 2019, 03:19:08 AM »
Another speedup maybe could come by caching the directory entries in src.zip only the first time it is read instead of every time one hits '(' ? This src.zip file is not going to change. So if SE has saved this directory cache previously, then it only needs to unzip one file.

Probably not as fast as unzipping it to begin with (which I would love to have), but maybe close enough?