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 27710 - Improve UI responsiveness of first file opening
Summary: Improve UI responsiveness of first file opening
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: All All
: P1 blocker (vote)
Assignee: issues@editor
URL:
Keywords: PERFORMANCE
: 27790 (view as bug list)
Depends on: 18210 23340 26914 28595 28870
Blocks: 26581 27183 27791
  Show dependency tree
 
Reported: 2002-10-01 14:41 UTC by Tomas Pavek
Modified: 2007-11-05 13:42 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
CPU profiling snapshot (OptimizeIt), sampler method (218.44 KB, application/octet-stream)
2002-10-03 09:28 UTC, Tomas Pavek
Details
CPU profiling snapshot (OptimizeIt), instrumentation (394.71 KB, application/octet-stream)
2002-10-03 09:33 UTC, Tomas Pavek
Details
CPU profiling snapshot - firts opening with warm-up preinitialization (121.71 KB, application/octet-stream)
2002-11-08 16:35 UTC, Tomas Pavek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Pavek 2002-10-01 14:41:21 UTC
Opening a file in editor is very slow for the
first time, either it is java or e.g. plain text.
For simple java file it's about 4 seconds. It
seems to be significantly longer than in 3.3.2
(under 3 seconds). We should investigate the
opening process and find a way to improve it.
Ideally, the file should be opened under 1 sec. If
it is not possible, there should be some adequate
"progress" feedback for the user.

Note this is not just problem of editor, e.g. java
module or window system are probably involved too.


I'm attaching some measurement results... Measured
on newly started IDE (deleting user dir before
each start), always
selected the file in Explorer first, then opened
by pressing
Enter. Then closed the file and opened again. This
gave 1st
and 2nd times.

Configuration:
  NetBeans 3.3.2 build 20020605 (NB332)
  NetBeans 4.0 dev build 20020918 (NB40)
  - always running in MDI
  - JDK 1.4.0, W2K, PIII 733 MHz, 512 MB.

opening java - ColorPreview.java (3KB)
1st NB332   2109  2156  2188  2156  2203
    NB40    4203  4250  4297  4328  4359
2nd NB332    250   282   219   219   204
    NB40     437   375   422   375   437


opening TXT - README.txt from colorpicker (<1KB)
1st NB332   1812  1672  1765  1766  1796
    NB40    2812  2609  2688  2672  2671
2nd NB332    141   172   171   187   188
    NB40     234   250   219   266   219


(Note that NB332 1st times are higher about 800ms
if NOT deleting user dir between user starts.
Strange...)


I can attach some snapshots from CPU profiling -
if interested.
Comment 1 Tomas Pavek 2002-10-03 09:28:40 UTC
Created attachment 7577 [details]
CPU profiling snapshot (OptimizeIt), sampler method
Comment 2 Tomas Pavek 2002-10-03 09:33:29 UTC
Created attachment 7578 [details]
CPU profiling snapshot (OptimizeIt), instrumentation
Comment 3 Tomas Pavek 2002-10-03 11:24:31 UTC
The sampler snapshot is good for examining relative time distribution,
instrumentation snapshot shows method invocation counts (all methods
calls are recorded).
Comment 4 Tomas Pavek 2002-10-07 16:24:49 UTC
*** Issue 27790 has been marked as a duplicate of this issue. ***
Comment 5 Tomas Pavek 2002-11-08 15:32:41 UTC
The first time opening can be improved significantly by doing a
warm-up after the IDE start. See issue 28595. I'll attach a snapshot
showing the rest of the problems (when the warmup patch is applied).
Comment 6 Tomas Pavek 2002-11-08 16:35:45 UTC
Created attachment 7898 [details]
CPU profiling snapshot - firts opening with warm-up preinitialization
Comment 7 Tomas Pavek 2002-11-08 16:47:41 UTC
There are two main time expensive things visible now:
- updating NavigationView on addNotify(),
- refreshing editor toolbar from NbEditorUI.createExtComponent().

I believe both things could be postponed and done after the file is
opened (editor is painted). Switching off the toolbar improves the
first file opening significantly (about 700ms of 4s).
Comment 8 _ pkuzel 2002-11-13 12:58:25 UTC
Another point of view is size of opened text. Mila confirmed that huge
files are completely read into memory before the first line is being
displayed. Also reported as issue 18210.
Comment 9 Tomas Pavek 2002-11-13 15:02:17 UTC
Additional measuring: opening 209KB java file (the largest one in
NetBeans codebase). You may compare with small file numbers from
above. The difference is noticeable, but the file is really huge (over
5000 lines). So I think this is rather a secondary problem, showing up
in extreme cases...

1st NB40  5344  5375  5625  5343  5501
2nd NB40  1000   953  1016   922   937
Comment 10 Marian Mirilovic 2002-11-22 10:38:40 UTC
Marian's measurement (time in milliseconds):
conditions: 
 - SUN UltraSparc60 / 512 MB RAM / Solaris 5.8 / CDE
 - JDK1.4.1(01)
 - [nb_dev](200211140100) , MDI
        - mounted sampledir

opening files
 open form [ColorPicker] 
	- SE closed            316/14262       3878    3754
        - SE opened            3765            1537    822
 open java [ColorPreview]
        - SE closed            7040            716     283
        - SE opened            501             433     422
 open txt [Readme]
        - SE closed            4176            616     495
        - SE opened            651             377     358

Test cases described on page :
http://performance.netbeans.org/qa/TestSuites.html#open_java_file
Comment 11 Tomas Pavek 2003-02-11 15:03:29 UTC
Please focus on this primarily for M3, issue 28595 should help.
Comment 12 Tomas Pavek 2003-02-26 17:35:48 UTC
We can close this as fixed I think. Warm-up did most of the job (issue
28595). I created new issue 31510 for the toolbar initialization.