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

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5148
  • Hero Points: 425
Re: Java multiple second freeze after typing ( after get function
« Reply #15 on: December 19, 2019, 03:30:44 am »
There definitely could be better caching. Would be easy to "lock" a zip file cache in memory. Not easy to know when to "unlock" it and free the memory. Might be easier to configure the cache timeout per zip file (maybe keep it for 15 minutes). Right now, once a zip file isn't accessed for about 1 second, then it is closed. That's needed for recursively searching through many zip files and not just keeping all the cached zip files in memory.
« Last Edit: December 19, 2019, 03:39:26 am by Clark »

rowbearto

  • Senior Community Member
  • Posts: 1617
  • Hero Points: 118
Re: Java multiple second freeze after typing ( after get function
« Reply #16 on: December 19, 2019, 03:45:03 am »
Dennis: Tried your hotfix, doesn't seem to make any change. I still wait many seconds, and I do see the function parameters and comments.

I used "Load Hot Fix", loaded it, but did not restart SE, and then tried the '('.
« Last Edit: December 19, 2019, 03:58:38 am by rowbearto »

rowbearto

  • Senior Community Member
  • Posts: 1617
  • Hero Points: 118
Re: Java multiple second freeze after typing ( after get function
« Reply #17 on: December 19, 2019, 04:05:26 am »
Another discovery, if I have the following checked:

"Auto-display parameter information"
"Auto-insert matching parameter"
"Auto-list compatible parameters"

It seems that after the '(', the "auto-list" does not work, I don't see any auto-list.

However if I disable "auto-insert", then the auto-list occurs.

I would expect the "auto-list" to work even if "auto-insert" is checked? Is that a bug?

Also, with "auto-insert", the '(' after get inserts "index" which is the parameter name in the prototype of "get", however I don't have any variables named "index" so why is it shown there?

rowbearto

  • Senior Community Member
  • Posts: 1617
  • Hero Points: 118
Re: Java multiple second freeze after typing ( after get function
« Reply #18 on: December 19, 2019, 01:48:32 pm »
Clark: I would propose that for the special case of the src.zip file for Java, to "lock" the cache to it when a Java project is opened, and "unlock" it when the Java project is closed.

If someone opens a Java file without a project, can "lock" it when '(' is pressed, and unlock when SE closes.

I'm guessing this cache may take about 1MB of memory for this file? If that is correct it is a small amount of memory to pay for the speed, assuming it really does speed it up dramatically. Otherwise unzipping during tagging may be better.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5148
  • Hero Points: 425
Re: Java multiple second freeze after typing ( after get function
« Reply #19 on: December 19, 2019, 02:18:42 pm »
I did a quick test and hard wire locked src.zip in memory. On my fairly fast machine, saves about .75 seconds. On my VM I'm sure it would save more time.

Here's a work around that saves even more time, you can do yourself, and it's not obvious:

Start a Windows shell as administrator
cd "c:\program files\java\jdk-11.0.5"
mkdir src
cd src
jar xvf ..\lib\src.zip
cd ..\lib
ren src.zip src.zip.old

The above steps will trick SlickEdit into thinking your JDK is configured with actual source and not a src.zip file. You will need to delete your JDK tag file (pretty sure that will force a rebuild). I did this with a clean config and it worked. On my fairly fast machine, saves about 1.25-1.5 seconds. On my VM I'm sure it would save more time.

This testing tells me that it would be best if SlickEdit unzipped src.zip in the users config directory. It's much slower to tag the individual Java files due to the number of file opens required but it's much faster to use it.

rowbearto

  • Senior Community Member
  • Posts: 1617
  • Hero Points: 118
Re: Java multiple second freeze after typing ( after get function
« Reply #20 on: December 19, 2019, 03:26:35 pm »
Thanks Clark!

That workaround does seem to speed things up significantly, but I think I'm still waiting about 1-2 seconds (but much better than multiple seconds).

I will continue working with it to see how I like it.

My jdk src directory is on my C drive, which is an SSD. SlickEdit is on my D drive, which is a 7200 rpm HDD, and the tag files are also on the D drive. Moving SE to the SSD/C drive would present many difficulties for me, as the D drive has my "home" directory that I sync with other computers. Not sure it would pay off much anyway, but maybe.

rowbearto

  • Senior Community Member
  • Posts: 1617
  • Hero Points: 118
Re: Java multiple second freeze after typing ( after get function
« Reply #21 on: December 19, 2019, 03:41:22 pm »
It appears to be the "auto-list compatible parameters" that is causing the remaining few seconds delay. When I turn that off, barely any delay even if I have "show comments" enabled. I turned off "auto-insert matching parameter" as I've found what it is inserting is not really useful.

rowbearto

  • Senior Community Member
  • Posts: 1617
  • Hero Points: 118
Re: Java multiple second freeze after typing ( after get function
« Reply #22 on: December 19, 2019, 03:58:00 pm »
If I have both "auto-insert matching parameter" and "auto-list compatible parameters" checked, there is no delay, however there is also no auto-listing, which I find more useful than the "auto-insert". I think it is a bug in SE that the auto-list doesn't occur in this case as I mentioned in a previous post?

It is only when "auto-list" is enabled while "auto-insert" is disabled that I get the extra few seconds delay, which is a little annoying, but still much better now that the file is unzipped (but I would still like to eliminate it if possible).