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 240062 - CodeCompletion took 12545 ms.
Summary: CodeCompletion took 12545 ms.
Status: RESOLVED WORKSFORME
Alias: None
Product: editor
Classification: Unclassified
Component: Parsing & Indexing (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2014-01-07 09:45 UTC by Exceptions Reporter
Modified: 2014-01-07 10:32 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 206364


Attachments
nps snapshot (413.57 KB, application/nps)
2014-01-07 09:46 UTC, Exceptions Reporter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2014-01-07 09:45:55 UTC
This issue was reported manually by sdedic.
It already has 1 duplicates 


Build: NetBeans IDE 7.4 Beta (Build 201307092200)
VM: OpenJDK 64-Bit Server VM, 23.7-b01, OpenJDK Runtime Environment, 1.7.0_17-mockbuild_2013_04_05_13_08-b00
OS: Linux

User Comments:
GUEST: code completion takes ages when it just was instant



Maximum slowness yet reported was 12545 ms, average is 12545
Comment 1 Exceptions Reporter 2014-01-07 09:46:00 UTC
Created attachment 143662 [details]
nps snapshot
Comment 2 Svata Dedic 2014-01-07 09:50:14 UTC
The Parser result tasks should support priorities + cancelling & restarting of lower priority (background, uninteractive) tasks. 
Hints evaluation is captured in the attached profiler snapshot. 
Each of the (uninterruptible) hint analysis takes ~1 seconds, but in sum the hints task takes too long time blocking others from parsing results. In this case no mutation which would cancel the pending task is done, only completion is invoked, which does not change the source, but prompt response is expected.

If the CC parsing result task could cancel the hint evaluation (which could be restarted later), the responsiveness would be greatly improved. Of course, hints task cooperation would be required (e.g. to replan hints task re-execution), but no API for such cooperation exists, IMHO.
Comment 3 Tomas Zezula 2014-01-07 10:15:02 UTC
The hint run as ParserResultTask which is cancelled by the UserTask and reinvoked after the UT finished.
Comment 4 Tomas Zezula 2014-01-07 10:20:24 UTC
The HintTask is cancelled by HT.cancel() method.
Seems that the Scanner does not check cancelled flag.
Comment 5 Svata Dedic 2014-01-07 10:32:14 UTC
sorry; will fix in the scanner.