[ 
https://issues.apache.org/jira/browse/NETBEANS-238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16311849#comment-16311849
 ] 

Jan Lahoda commented on NETBEANS-238:
-------------------------------------

I was trying to peek at this. I concur it is probably due to the File.list() 
(which by experience appears to be pretty slow under Windows).

At this time, my hypothesis is this:
-in JDK 9, there are about 70 modules
-in NetBeans, each of these modules is on the bootpath separatelly, even for 
"-source 8"
-but there is also a cache folder for each of those that is commonly empty (it 
may contain e.g. classes with filled parameter names, etc.)
-the code completion is trying to create PackageElements for many packages, 
which tries to list the package content.

This leads to (# of packages) * (# of modules) File.list invocations (which 
usually fail/return empty results). The snapshot shows most of the time is 
spent listing folders, which was the base for this hypothesis.

I'll attach an experimental patch which tries to limit the # of File.list 
invocations in cases like this. Gili, if you could try with the patch, that'd 
be helpful.


> Invoking code-complete in Maven projects is extremely slow
> ----------------------------------------------------------
>
>                 Key: NETBEANS-238
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-238
>             Project: NetBeans
>          Issue Type: Bug
>          Components: java - Editor
>    Affects Versions: 9.0
>         Environment: build 152
>            Reporter: Gili
>            Priority: Critical
>         Attachments: SlowCodeCompleteAntAndMaven.zip, 
> code-complete-profiler.npss
>
>
> Say I'm in a class that has a field {{singletonScope}} where this class is 
> defined within the same Maven module.
> I type {{singletonScope.}} then wait for auto-complete to suggest possible 
> methods. Code-complete takes roughly 10 seconds to come back.
> This is reproducible 100% of the time.
> Expected behavior: Code-complete should complete within 300ms or less.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to