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 240880 - CodeCompletion took 2228 ms.
Summary: CodeCompletion took 2228 ms.
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 8.0
Hardware: All All
: P1 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2014-01-23 12:55 UTC by KhArtNJava
Modified: 2014-02-20 03:02 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 206892


Attachments
nps snapshot (24.17 KB, application/nps)
2014-01-23 12:55 UTC, KhArtNJava
Details
nps snapshot (86.74 KB, application/nps)
2014-02-04 19:04 UTC, Exceptions Reporter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description KhArtNJava 2014-01-23 12:55:13 UTC
This bug was originally marked as duplicate of bug 214275, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build 201401230001)
VM: Java HotSpot(TM) Client VM, 24.51-b03, Java(TM) SE Runtime Environment, 1.7.0_51-b13
OS: Windows Server 2008

User Comments:
KhArtNJava: on javascript code editing



Maximum slowness yet reported was 2228 ms, average is 2228
Comment 1 KhArtNJava 2014-01-23 12:55:15 UTC
Created attachment 144293 [details]
nps snapshot
Comment 2 Exceptions Reporter 2014-02-04 19:04:17 UTC
Created attachment 144798 [details]
nps snapshot

hes got a lot to think about...
Comment 3 Tomas Zezula 2014-02-17 15:04:25 UTC
In fact nothing to do with parsing.api.
Caused by changes of Utilities.toURI() which needlessly accesses disk, before JDK 7 rewrite to use j.nio.Path it used j.io.File.toURI().

Also it's questionable what CSS|HTML code completion does with all the files.
Comment 4 Tomas Zezula 2014-02-17 15:11:11 UTC
In my opinion one possible easy fix is to change CssIndex & friends like this:

for(IndexResult result : results) {
-            FileObject resultFile = result.getFile(); //can be null as the file can be removed/moved
+            URI resultFile = uriOrNull(result.getURL);
            if(resultFile != null && resultFile.equals(fileURI)) {
                return factory.loadFromIndex(result);
            }
        }

Which saves O(n) calls of Utilities.toURI() and O(n) non needed disk touches.
I will try to find all the places which need to be changed like this.
Comment 5 Tomas Zezula 2014-02-18 16:21:12 UTC
Fixed jet-main cafe8f1ef534
What a nice hg hash :-)
Comment 6 Quality Engineering 2014-02-20 03:02:53 UTC
Integrated into 'main-silver', will be available in build *201402200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/cafe8f1ef534
User: Tomas Zezula <tzezula@netbeans.org>
Log: #240880:CodeCompletion took 2228 ms.