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 252310 - org.openide.text.NbDocument$DocumentRenderer.renderToInt: LowPerformance took 255234 ms.
Summary: org.openide.text.NbDocument$DocumentRenderer.renderToInt: LowPerformance took...
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 8.0
Hardware: All All
: P2 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords: 8.1_WAIVER_APPROVED, PERFORMANCE
: 90901 (view as bug list)
Depends on: 255955
Blocks:
  Show dependency tree
 
Reported: 2015-05-08 17:31 UTC by Exceptions Reporter
Modified: 2016-02-08 14:44 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 217198


Attachments
nps snapshot (128.46 KB, application/nps)
2015-05-08 17:31 UTC, Exceptions Reporter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2015-05-08 17:31:36 UTC
This bug was originally marked as duplicate of bug 182614, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 8.0.2 (Build 201411181905)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.31-b07, Java(TM) SE Runtime Environment, 1.8.0_31-b13
OS: Mac OS X

User Comments:
GUEST: I clicked on the line to change code



Maximum slowness yet reported was 25234 ms, average is 25234
Comment 1 Exceptions Reporter 2015-05-08 17:31:40 UTC
Created attachment 153571 [details]
nps snapshot
Comment 2 Vladimir Voskresensky 2015-08-28 18:20:35 UTC
Mila, it looks like I was able to reproduce this slowness. I finally waited long enough not killing IDE. Have a look at my 260sec report
Comment 3 Vladimir Voskresensky 2015-08-28 18:22:13 UTC
http://statistics.netbeans.org/exceptions/exception.do?id=791340
Comment 4 Miloslav Metelka 2015-09-07 08:29:45 UTC
It appears like the problem with the o.o.text.Line.Set.whm which I'll be rewriting to a more efficient impl within NB 8.1.
Comment 5 Vladimir Voskresensky 2015-09-07 13:07:10 UTC
Looking for the fast version for verification.
Comment 6 Miloslav Metelka 2015-09-15 15:08:19 UTC
Yes, report 791340 hits the o.o.text.Line.Set.whm problem.


Report 793487 has problem with lineParts - there are 3944 calls to LineSet.getCurrent() i.e. there's at least 3944 line parts on a single line.

I've grep-ed sources for Line.createPart() but there does not seem to be too many usages across the sources - one notable is in NbToolTip - due to necessity of calling Annotations for tooltip providing a LinePart is created.
With added logging in terms of issue #90901 it can be proved that each stop of the mouse cursor creates and registers an extra LinePart instance on the line. Most of the lines are just temporary but lines with breakpoint/bookmark are "permamnent" so their associated LineParts accumulate.
Comment 7 Miloslav Metelka 2015-09-29 13:49:56 UTC
*** Bug 90901 has been marked as a duplicate of this bug. ***
Comment 8 Vladimir Voskresensky 2015-09-29 19:17:44 UTC
I just checked the current state and would like to to record my reproducible scenario:
- open APInt
- show annotations
- position to line with "public class APInt" declaration
ask show HG Annotation for previous in APInt (for rev 11158) 
Then IDE is stuck. Hopefully I'll have new snap
Comment 9 Vladimir Voskresensky 2015-09-29 19:19:35 UTC
Great!
statistics.netbeans.org/analytics/exception.do?id=795733
It is already 5 times faster than before!
Although still 59 sec
Comment 10 Vladimir Voskresensky 2015-09-29 19:19:54 UTC
http://statistics.netbeans.org/analytics/exception.do?id=795733
Comment 11 Miloslav Metelka 2015-09-30 08:21:24 UTC
Vladimir, thanks for the steps. The speedup should be due to removal of extra locking (integrated as part of issue #90901).
As the fix is rather complex (btw there will need to be an extra API in the editor.lib2 for undo-stable positions) it should be first tested thoroughly since any mistake in the o.o.text.Line processing would have fatal consequences. I will integrate the fix into the trunk after 8.1 branch gets created and once the fix gets stabilized we can integrate it into the first patch for 8.1.
Downgrading to P2 and asking for waiver for 8.1.
Comment 12 Jiri Kovalsky 2015-09-30 13:11:04 UTC
Bug waiver for 8.1 approved.
Comment 13 Miloslav Metelka 2015-10-14 15:16:37 UTC
http://hg.netbeans.org/jet-main/rev/94daac74aa9d
The fix seems to work fine. Vladimir please test it on your test case. Thanks.
I have updated the fix to not require any changes in editor.lib.
Comment 14 Quality Engineering 2015-10-15 01:22:48 UTC
Integrated into 'main-silver', will be available in build *201510150002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/94daac74aa9d
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #252310 - org.openide.text.NbDocument$DocumentRenderer.renderToInt: LowPerformance took 255234 ms - Binary search in LineVector used for o.o.text.Line finding.
Comment 15 Vladimir Voskresensky 2015-10-15 08:44:24 UTC
You are "Mila the Great"!
It is instant now!
I'm nominating it for 8.1 patch candidate

Thank you VERY MUCH!
Comment 16 Vladimir Voskresensky 2015-11-24 16:43:35 UTC
Ilia will transplant this one for studio into release81
Comment 17 Jiri Kovalsky 2016-02-04 13:45:21 UTC
Changeset from releases repository please? Thanks!
Comment 18 Alexander Simon 2016-02-04 15:01:46 UTC
changeset:   304954:11f75a421795
branch:      release81
user:        Miloslav Metelka <mmetelka@netbeans.org>
date:        Wed Oct 14 17:15:48 2015 +0200
summary:     #252310 - org.openide.text.NbDocument$DocumentRenderer.renderToInt: LowPerformance took 255234 ms - Binary search in LineVector used for o.o.text.Line finding.
Comment 19 Vladimir Voskresensky 2016-02-08 14:44:30 UTC
v.