This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 202247 - CodeCompletion took 14148 ms.
Summary: CodeCompletion took 14148 ms.
Status: RESOLVED DUPLICATE of bug 197297
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Completion (show other bugs)
Version: 7.0
Hardware: All All
: P2 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2011-09-16 17:12 UTC by stiffuser
Modified: 2012-04-03 18:42 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 179087


Attachments
nps snapshot (200.89 KB, application/nps)
2011-09-16 17:12 UTC, stiffuser
Details
nps snapshot (213.74 KB, application/nps)
2011-09-20 15:34 UTC, stiffuser
Details
nps snapshot (24.88 KB, application/nps)
2011-10-19 13:05 UTC, PrakharMathur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stiffuser 2011-09-16 17:12:18 UTC
This issue was reported manually by stiffuser.
It already has 5 duplicates 


Build: NetBeans IDE 7.0.1 (Build 201107282000)
VM: Java HotSpot(TM) 64-Bit Server VM, 20.1-b02-383, Java(TM) SE Runtime Environment, 1.6.0_26-b03-383-11A511
OS: Mac OS X

User Comments:
GUEST: small project, Ctrl+space twice, even these start options don't help:
-J-Xss2m -J-Xms400m -J-XX:PermSize=64m -J-Dsun.java2d.opengl=true -J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled
-J-Xmx400m -J-XX:MaxPermSize=64m



Maximum slowness yet reported was 14148 ms, average is 7587
Comment 1 stiffuser 2011-09-16 17:12:26 UTC
Created attachment 110824 [details]
nps snapshot
Comment 2 Vladimir Voskresensky 2011-09-16 18:46:43 UTC
completion is waiting for file to be parsed.
Comment 3 stiffuser 2011-09-20 15:34:07 UTC
Created attachment 110921 [details]
nps snapshot
Comment 4 nnnnnk 2011-09-29 14:34:17 UTC
Operations with filesystem takes a lot.
I guess NetBeans does not have enough memory.
Setting of -J-Xmx and -J-XX:PermSize could help.
Comment 5 Vladimir Voskresensky 2011-09-29 16:18:47 UTC
there are serveral snapshots with problems
SEVERE [org.openide.util.Exceptions]
java.net.URISyntaxException: Illegal character in path at index 0: 

INFO [cnd.logger]: Calling Parser in UI Thread
java.lang.Exception: Calling Parser in UI Thread
    at org.netbeans.modules.cnd.utils.CndUtils.assertTrueInConsole(CndUtils.java:197)
    at org.netbeans.modules.cnd.modelimpl.csm.deep.LazyStatementImpl.createStatements(LazyStatementImpl.java:102)
    at org.netbeans.modules.cnd.modelimpl.csm.deep.LazyStatementImpl.getStatements(LazyStatementImpl.java:85)
Comment 6 PrakharMathur 2011-10-19 13:05:53 UTC
Created attachment 112223 [details]
nps snapshot

I tried completing a local variable name and it took a lot of time.
Comment 7 Leonid Lenyashin 2011-11-04 16:49:27 UTC
Code Completion must be instantaneous.
Comment 8 Vladimir Voskresensky 2011-11-07 14:18:46 UTC
(In reply to comment #6)
> Created an attachment (id=112223) [details]
> nps snapshot
> 
> I tried completing a local variable name and it took a lot of time.
I need more info.
- was it the case after IDE restart where project previously was already parsed? Or it was during parse of project?
- were semantic highlighting already colored document (i.e. function names are in bold, fields are green, ...)
Comment 9 Vladimir Voskresensky 2011-11-07 14:36:20 UTC
https://netbeans.org/bugzilla/attachment.cgi?id=112223
in this snapshot IDE is reading from global ns members from repository
Comment 10 Vladimir Voskresensky 2011-11-09 13:41:51 UTC
Snapshots analysis shows that slowness has several reasons:
- first use of completion (after restoring from repository)
-- restoring from repository is lazy, so some objects are deserialized first time in completion query
- completion query is waiting for one file to be parsed
-- file has deep includes
- completion query is visiting file and it's inclusions when inclusions are possibly have cycles due to symlinks structure

Fix of this issues is risky in 7.1 timeframe
Comment 11 Vladimir Voskresensky 2012-04-03 18:42:03 UTC
I've separated logs.
In this one I've left only related to repository. 
1) Not enough memory, we recommend to give NB -J-Xmx1G
2) memory is OK, but few first usages of completion after opening IDE or project - repository is reading indexes into memory.

*** This bug has been marked as a duplicate of bug 197297 ***