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 190828 - Performance issues while typing (deleting) code
Summary: Performance issues while typing (deleting) code
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal with 1 vote (vote)
Assignee: Petr Pisl
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2010-10-07 14:04 UTC by dziastinux
Modified: 2011-12-13 07:19 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Profiler data (287.48 KB, application/octet-stream)
2010-10-07 14:06 UTC, dziastinux
Details
NetBeans log file (28.37 KB, application/octet-stream)
2010-10-07 14:06 UTC, dziastinux
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dziastinux 2010-10-07 14:04:45 UTC
For a 'large' JS files (~4k lines) typing/deleting lags for a second or two.

How to reproduce:
 1. Open large JS file;
 2. Copy a few code lines (if/for statment is prefered)
 3. Paste those line in somewhere
 4. Select half of the pasted block
 4. Hit Delete button in keyboard
 5. Notice CPU usage (it will drop after a few seconds).

Product Version = NetBeans IDE 6.9.1 (Build 201007282301)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.6.0_21
Runtime = Java HotSpot(TM) Client VM 17.0-b17
Comment 1 dziastinux 2010-10-07 14:06:01 UTC
Created attachment 102295 [details]
Profiler data
Comment 2 dziastinux 2010-10-07 14:06:14 UTC
Created attachment 102296 [details]
NetBeans log file
Comment 3 Marek Fukala 2011-03-08 21:08:56 UTC
A very brief analysis of the snapshot:

Approximately 14 seconds spent in the JsHintsProvider resolving the JS expressions. This involves more than 1000 invocations of JsTypeAnalyzer.expressionType() which involves about 700 lucene index queries.

What I can spot suspicious here is the amount of the index queries. I believe each query involves a disk IO operations so this could be definitively improved by some caching.

Another question is how accurate are the type analyzer result and hence how useful are the hints themselves. 

Definitively disabling the javascript.hints module would help here a lot.
Comment 4 Marian Mirilovic 2011-03-15 15:23:50 UTC
Waiver request for >48 hours -> switch to waiver 
http://wiki.netbeans.org/WaiverProcess
Comment 5 Petr Jiricka 2011-05-04 09:06:18 UTC
Also requesting waiver for 7.0.1.
Comment 6 Petr Jiricka 2011-05-06 14:51:08 UTC
Approved.
Comment 7 Petr Pisl 2011-11-02 13:00:02 UTC
There were done a few changes that should improve this behavior. I have tested it with uncompressed dojo.js file (11 thousands lines) and I can not see the behavior as is described here. 

For now I'm closing as fixed, but if you have still problem with it, please reopen. It can happen that the exact case is not by the correcting catch. Thanks.
Comment 8 Vladimir Riha 2011-12-13 07:19:53 UTC
I tried with 7k lines js file and it seems to work fine, verified

Product Version: NetBeans IDE 7.1 (Build 201112071828)
Java: 1.7.0_02; Java HotSpot(TM) Client VM 22.0-b10
System: Linux version 3.0.0-13-generic-pae running on i386; UTF-8; en_US (nb)