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 55542 - Noticable slowdown when scrolling by cursor in long HTML
Summary: Noticable slowdown when scrolling by cursor in long HTML
Status: CLOSED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Editor (show other bugs)
Version: 4.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Marek Fukala
URL:
Keywords: PERFORMANCE
Depends on: 41508
Blocks:
  Show dependency tree
 
Reported: 2005-02-25 15:24 UTC by Jiri Kovalsky
Modified: 2009-05-18 10:45 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
HTML file where bug is reproducible. (24.02 KB, text/html)
2005-02-25 15:25 UTC, Jiri Kovalsky
Details
The invocation tree showing method calls in the getPositionBelow() method (129.03 KB, text/plain)
2005-03-01 15:21 UTC, Marek Fukala
Details
Now the some invocation tree with correct mimetype :-) (129.03 KB, text/html)
2005-03-01 15:23 UTC, Marek Fukala
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Kovalsky 2005-02-25 15:24:23 UTC
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".
Comment 1 Jiri Kovalsky 2005-02-25 15:25:21 UTC
Created attachment 20523 [details]
HTML file where bug is reproducible.
Comment 2 Jiri Kovalsky 2005-02-25 15:26:28 UTC
This is performance issue.
Comment 3 Marek Fukala 2005-03-01 13:35:36 UTC
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.
Comment 4 Marek Fukala 2005-03-01 15:19:09 UTC
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.

Comment 5 Marek Fukala 2005-03-01 15:21:08 UTC
Created attachment 20594 [details]
The invocation tree showing method calls in the getPositionBelow() method
Comment 6 Marek Fukala 2005-03-01 15:23:04 UTC
Created attachment 20595 [details]
Now the some invocation tree with correct mimetype :-)
Comment 7 Marek Fukala 2005-03-01 17:11:29 UTC
The Issue #41508 which this issue depends on is going to be fixed in
4.1 => setting TM accordingly
Comment 8 Jiri Kovalsky 2005-03-03 13:28:06 UTC
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.
Comment 9 Marek Fukala 2005-03-04 15:50:55 UTC
Issue #41508 has been fixed => closing this one as well. Please reopen
if you feel that the navigation is still too slow.
Comment 10 Jiri Kovalsky 2005-03-24 14:51:47 UTC
Okay, I agree it was improved though it still "jumps". Anyway, verifying in
development build #200503232205 of NetBeans 4.1.