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.
Development build #200502241900 of NetBeans 4.1 Windows XP, JDK 1.5.0_02 build #05 Description: ============ When arrow is used to move cursor in long HTML file for scrolling down, it starts to skip lines and jumps for example over 10 lines resulting in 100% CPU utilization. Steps to reproduce: =================== 1. Create new sample web application project. 2. Save attached HTML in the project and open it. 3. Wait till code folds are created. 4. Push arrow down key and hold it until you reach end of the document. 5. Note that from line 17 below the cursor won't scroll smoothly and it starts to "jump".
Created attachment 20523 [details] HTML file where bug is reproducible.
This is performance issue.
The problem is caused by method org.netbeans.editor.Utilities.getPositionBelow(...) called from org.netbeans.editor.BaseKit$DownAction class. This method is called after each press of down arrow key and it takes very long time. This method now only delegates to javax.swing.text.Utilities.getPositionBelow(...) method which is so slow. It used to compute the position by itself, but it was changed on Jan 09th, 2004 by Milas's commit "Code Folding integration to main trunk" rev. 1.63. I need more information from editor guys to be able to set TM.
The Issue #41508 is very likely the source of the problem. Too long lines causes that the avax.swing.text.Utilities.getPositionBelow(...) is terribly slow. I am attaching a call tree graph from JProfiler created in following way: 1) open the Jiri's HTML file 2) delete 2/3 of lines in the file 3) jump to the beginning of the file 4) set cursor onto last visible row 5) press down array key => from the call tree graph it is perfectly visible that one call to getPositionBelow() causes 20408 calls of org.netbeans.editor.Syntax.nextToken() and then the some amount of calls to org.netbeans.editor.DrawEngine.drawCurrentToken(). The some line is reparsed and repainted 370 times!!! I would like to ask Jirka Kovalsky to reconside priority of this issue. This is IMO a P2.
Created attachment 20594 [details] The invocation tree showing method calls in the getPositionBelow() method
Created attachment 20595 [details] Now the some invocation tree with correct mimetype :-)
The Issue #41508 which this issue depends on is going to be fixed in 4.1 => setting TM accordingly
Since this usecase comes from real-life usage of HTML editor and it is really not funny I am upgrading priority of this issue. Actually I wanted to file this as P2 originally. Please make sure the editor is usable not only with fresh HTMLs generated from templates.
Issue #41508 has been fixed => closing this one as well. Please reopen if you feel that the navigation is still too slow.
Okay, I agree it was improved though it still "jumps". Anyway, verifying in development build #200503232205 of NetBeans 4.1.