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 44661 - [perf] Opening first java file in editor takes significantly longer than in NB 3.6
Summary: [perf] Opening first java file in editor takes significantly longer than in N...
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P2 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords: PERFORMANCE, REGRESSION
: 41828 43159 (view as bug list)
Depends on: 44099
Blocks:
  Show dependency tree
 
Reported: 2004-06-09 18:00 UTC by Antonin Nebuzelsky
Modified: 2007-09-26 09:14 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
commit log (2.47 KB, text/plain)
2004-07-29 21:09 UTC, Jan Pokorsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonin Nebuzelsky 2004-06-09 18:00:56 UTC
* Dell Precision 220, PIII 800MHz, 512MB RAM, W2K
* JDK 1.4.2_04
* trunk build 200406082045 versus NB 3.6 FCS
* three measurements of all cases below with a
restart of the IDE before measuring each number
* Main20kB.java and Main.java can be found in cvs
in core/test/qa-performance/src/gui/data/


(1) Opening Main20kB.java in editor as the first
file after IDE start

code-folding ON:
nb36  - 1328ms, 1312ms, 1328ms
trunk - 5156ms, 3531ms, 2890ms

code-folding OFF:
nb36  - 859ms, 891ms, 906ms
trunk - 2984ms, 3265ms, 2848ms

(2) Opening Main20kB.java in editor if the file
Main.java is already open

code-folding ON:
nb36  - 938ms, 937ms, 938ms
trunk - 1031ms, 984ms, 906ms

code-folding OFF:
nb36  - 735ms, 828ms, 766ms
trunk - 593ms, 640ms, 812ms


As you can see only the first file opening time is
regressed.

The first code-folding hierarchy initialization
has some overhead. Mila is going to do changes in
this code (see issue 
44099).

Optimization is also needed in initialization of
the editor navigation combo box. When CF is OFF
the document is displayed in editor very quickly
and you can see that it takes very long time to
display the navigation combo. But only after the
combo is displayed the editor is ready and thus it
is counted to the opening time.
Comment 1 Antonin Nebuzelsky 2004-06-09 19:26:21 UTC
*** Issue 43159 has been marked as a duplicate of this issue. ***
Comment 2 Martin Roskanin 2004-06-17 15:14:42 UTC
*** Issue 41828 has been marked as a duplicate of this issue. ***
Comment 3 Miloslav Metelka 2004-06-30 14:55:11 UTC
The java fold manager was rewritten to not initialize the folds
synchronously (please see issue 42333). The NavigationView maintained
in the java module still populates its contents synchronously in AWT
which causes the slowdown but this can be eliminated by turning the
editor toolbar off.
Closing as the editor part of the problem should now be fixed. Please
reopen if necessary.
Comment 4 Antonin Nebuzelsky 2004-07-19 13:52:11 UTC
I have measured the current state with combinations of codefolding
ON/OFF, navigation view ON/OFF, opening first/second file.

* Dell Precision 220, PIII 800MHz, 512MB RAM, W2K
* JDK 1.4.2_04
* three measurements of all cases below with a restart of the IDE
before measuring each number
* Main20kB.java and Main.java can be found in cvs in
core/test/qa-performance/src/gui/data/


The numbers below describe the moment when the editor was responsive,
the numbers in parentheses describe the moment when the file was
displayed (the editor may not be responsive already at the moment).

CF ON
-----
opening Main20kB as the first file after IDE start
NV ON: 3265ms, 3406ms, 3328ms (displayed at 1250ms, 1343ms, 1338ms)
NV OFF: 735ms, 765ms, 703ms

opening Main20kb if Main is already open
NV ON: 1687ms, 1434ms, 1437ms (displayed at 1687ms, 672ms, 750ms)
NV OFF: 672ms, 641ms, 657ms

CF OFF
------
opening Main20kB as the first file after IDE start
NV ON: 1297ms, 1344ms, 1328ms
NV OFF: 672ms, 687ms, 672ms

opening Main20kb if Main is already open
NV ON: 1328ms, 1313ms, 1734ms (displayed at 922ms, 719ms, 1734ms)
NV OFF: 578ms, 563ms, 485ms


These measurements indicate that the rewrite of java fold manager
really helped to make the editor responsive sooner than only after all
folds are initialized.

However, the navigation view is making the editor unresponsive. This
will hopefully change after navigation view is rewritten to use JMI
instead of the source hierarchy bridge. Reopening and assigning to
java core folks.
Comment 5 Jan Becicka 2004-07-23 11:50:55 UTC
Honza Pokorsky is working on it AFAIK.
Comment 6 Jan Pokorsky 2004-07-29 21:08:36 UTC
The NavigationView is rewritten:
* removed dependency on java/srcmodel(NavigationView+JavaEditor)
* keys and nodes creation scheduled out of the awt event
queue(NavigationView+ClassChildren)
Comment 7 Jan Pokorsky 2004-07-29 21:09:43 UTC
Created attachment 16566 [details]
commit log
Comment 8 Jan Pokorsky 2004-07-30 16:32:32 UTC
FYI, the fix of #issue 46702 brings further performance improvement
for NavigationView.
Comment 9 Antonin Nebuzelsky 2004-08-04 13:11:02 UTC
Verified that the numbers have improved. We are not regressed any more.

* trunk build 20040804-0941
* jdk 1.4.2_04

CF ON
-----
opening Main20kB as the first file after IDE start
NV ON: 1171ms, 1156ms, 1219ms
NV OFF: 719ms, 781ms, 766ms

opening Main20kb if Main is already open
NV ON: 719ms, 672ms, 641ms
NV OFF: 688ms, 657ms, 625ms

CF OFF
------
opening Main20kB as the first file after IDE start
NV ON: 1000ms, 938ms, 1016ms
NV OFF: 734ms, 734ms, 750ms

opening Main20kb if Main is already open
NV ON: 735ms, 734ms, 719ms
NV OFF: 734ms, 734ms, 672ms
Comment 10 Quality Engineering 2007-09-20 12:09:41 UTC
Reorganization of java component