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 233815 - CodeCompletion took 2962 ms.
Summary: CodeCompletion took 2962 ms.
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: All All
: P2 normal (vote)
Assignee: Petr Pisl
URL:
Keywords: 7.4_HR_FIX, PERFORMANCE
: 234179 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-08-01 23:13 UTC by Petah
Modified: 2013-10-25 16:59 UTC (History)
18 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 202741


Attachments
nps snapshot (34.19 KB, application/nps)
2013-08-01 23:14 UTC, Petah
Details
nps snapshot (66.83 KB, application/nps)
2013-08-04 06:20 UTC, kosmonaffft
Details
nps snapshot (56.31 KB, application/nps)
2013-08-04 06:23 UTC, kosmonaffft
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petah 2013-08-01 23:13:54 UTC
This bug was originally marked as duplicate of bug 232354, 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 201307312300)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.7-b01, Java(TM) SE Runtime Environment, 1.7.0_17-b02
OS: Windows 8

User Comments:
petah: Slow



Maximum slowness yet reported was 2962 ms, average is 2962
Comment 1 Petah 2013-08-01 23:14:16 UTC
Created attachment 138161 [details]
nps snapshot
Comment 2 Petr Hejl 2013-08-02 10:29:03 UTC
This just seems to be slow filesystem. There is no big delay just lucene reading index. Is this happening all the time or just when the code completion is invoked for the first time. Can you share your project?
Comment 3 Petah 2013-08-02 10:31:36 UTC
Happens all the time. Constantly having performance issues with JS. I have even turned off JS file associations because of it.

This is one of the projects:

https://github.com/PANmedia/Raptor

Is especially bad when there is compiled JS files in the project dir (2-3MB of obfuscated JS).
Comment 4 ain 2013-08-02 11:38:27 UTC
It is definitely not the slow filesystem. I have a quad-core MacBook Pro with SSD and it performed smothly in 7.3.

For me also the minified JS of the source JS is in the project as by NodeJS module standard, having src/ and dist/ folders.

Netbeans remains running at 100+% CPU once this autocompletion is triggered once. Autocompletion hangs forever with "Please wait...", always.

Netbeans doesn't exit normally either, probably due to the running process. I always have to Force Quit it.

Running on Mac OS X 10.7.5.
Comment 5 Petah 2013-08-02 11:41:11 UTC
Same here I have a fast computer, including an SSD.

I also have some node modules, and JS distribution files in my projects. And NB also doesn't exit correctly for me as per: https://netbeans.org/bugzilla/show_bug.cgi?id=233740
Comment 6 Petr Hejl 2013-08-02 11:46:53 UTC
Ok, thanks for details.
Comment 7 Petr Hejl 2013-08-02 11:51:31 UTC
I think we have to somehow balance index size and completion size.
Comment 8 Petah 2013-08-02 11:54:16 UTC
Does NB index minified JS files?
Comment 9 Petr Hejl 2013-08-02 12:00:04 UTC
(In reply to comment #8)
> Does NB index minified JS files?
Yep I think so. I'll recheck, but there is no reason why this would be an exception.
Comment 10 kosmonaffft 2013-08-04 06:20:10 UTC
Created attachment 138242 [details]
nps snapshot

Work as usual...
Comment 11 kosmonaffft 2013-08-04 06:23:09 UTC
Created attachment 138243 [details]
nps snapshot

Work as usual...
Comment 12 Petr Hejl 2013-08-06 12:33:15 UTC
The only idea I have at the moment would be to make a type resolution for code completion optional. It looks like it is the major cause of slowness. What do you think?
Comment 13 ain 2013-08-06 12:48:09 UTC
IMHO, type resolution should be turned off for dynamic languages e.g. JavaScript.
Comment 14 Petr Hejl 2013-08-06 14:40:44 UTC
I introduced new option under Options->Completion->JavaScript to disable full type resolution. For now it is still enabled by default. Please test in disable state and let us know on performance/usability.

web-main 3f97a630d8cf
Comment 15 Petr Hejl 2013-08-06 14:43:54 UTC
(In reply to comment #14)
> I introduced new option under Options->Completion->JavaScript to disable full
> type resolution. For now it is still enabled by default. Please test in disable
> state and let us know on performance/usability.
> 
> web-main 3f97a630d8cf
It is Options->Editor->Code Completion->JavaScript actually.
Comment 16 Quality Engineering 2013-08-07 02:26:25 UTC
Integrated into 'main-silver', will be available in build *201308062300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/3f97a630d8cf
User: Petr Hejl <phejl@netbeans.org>
Log: #233815 - CodeCompletion took 2962 ms
Comment 17 Petr Hejl 2013-08-08 14:05:09 UTC
Reporters, any feedback on this?
Comment 18 Petah 2013-08-09 10:44:27 UTC
Sorry I haven't tried the latest dev build yet. Ill try and do it next week.
Comment 19 Petr Jiricka 2013-09-12 13:21:49 UTC
78 duplicates, including many from late August and September dev builds. Increasing priority to P2.
Comment 20 Petr Jiricka 2013-09-13 07:17:50 UTC
The workaround that helped for me is to turn off "Perform full type resolution" under Tools -> Options -> Editor -> Code Completion -> JavaScript language. 

If the functional impact of turning this checkbox is not large, then I would consider turning it off by default for NB 7.4.

Can others who ran into this bug please try this and report if it improves performance for you? Thanks.
Comment 21 Petr Pisl 2013-09-15 10:20:59 UTC
Fixed in web-main:

http://hg.netbeans.org/web-main/rev/7ce43aad1d41
Comment 22 Petr Pisl 2013-09-15 10:22:04 UTC
I have just set the default value to false, so the type resolution is not done for code completion items.
Comment 23 Petr Pisl 2013-09-15 11:47:26 UTC
This change http://hg.netbeans.org/web-main/rev/92f5faf8a956 just change the tests, which should be run with the type resolution switch on by default.
Comment 24 Petr Pisl 2013-09-15 15:13:33 UTC
Transplanted to the releases: http://hg.netbeans.org/releases/rev/941cb528d7d3
Comment 25 Quality Engineering 2013-09-16 02:00:58 UTC
Integrated into 'main-silver', will be available in build *201309160002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/7ce43aad1d41
User: Petr Pisl <ppisl@netbeans.org>
Log: #233815 - CodeCompletion took 2962 ms.
Comment 26 Jiri Skrivanek 2013-09-16 08:07:04 UTC
*** Bug 234179 has been marked as a duplicate of this bug. ***
Comment 27 Vladimir Riha 2013-09-16 11:49:54 UTC
Full type resolution is disabled by default in RC, but it affects e.g. KnockoutJS (perhaps also AngularJS) support in HTML quite a bit (especially with usage of foreach or with binding). Current state is code completion offers no suggestions instead of "everything" as in before and I often see issue 236019 in such cases (issue is unrelated, it was just made more visible with this change).

I would almost vote for reverting it to get better completion for these frameworks.



Product Version: NetBeans IDE 7.4 RC1 (Build 201309152201)
Java: 1.8.0-ea; Java HotSpot(TM) Client VM 25.0-b49
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b107
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Comment 28 Petr Jiricka 2013-09-16 12:44:55 UTC
> but it affects e.g. KnockoutJS (perhaps also AngularJS) support 
> in HTML quite a bit (especially with usage of foreach or with 
> binding). Current state is code completion offers no suggestions
> instead of "everything" as in before

It would be useful to have a bug report for this.
Comment 29 Petr Pisl 2013-09-16 12:55:02 UTC
I have just fixed issue #236019. It would be better to keep this fix as it is and propagate fix of issue #236019 to the releases, because the issue #236019 is remain here, but will not be visible by default :(.
Comment 30 Vladimir Riha 2013-09-16 13:05:27 UTC
Thanks, I'll wait to test it with the fix and file separate issue for the foreach/with case if it will be still reproducible
Comment 31 Vladimir Riha 2013-09-17 08:42:49 UTC
(In reply to Petr Jiricka from comment #28)
> It would be useful to have a bug report for this.

I tried web-main build and it is OK now, code completion is displayed. I'll build IDE from releases repo to be sure.
Comment 32 Vladimir Riha 2013-09-17 10:58:26 UTC
Seems to be fine also in 7.4

Product Version: NetBeans IDE 7.4 RC1 (Build 20130917-5b13ccf89b0f)
Comment 33 Vladimir Riha 2013-09-26 11:35:16 UTC
Verified, full type resolution is disabled by default

Product Version: NetBeans IDE 7.4 RC2 (Build 201309252201)
Java: 1.7.0_45; Java HotSpot(TM) Client VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b13
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)