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.
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.
Created attachment 7577 [details] CPU profiling snapshot (OptimizeIt), sampler method
Created attachment 7578 [details] CPU profiling snapshot (OptimizeIt), instrumentation
The sampler snapshot is good for examining relative time distribution, instrumentation snapshot shows method invocation counts (all methods calls are recorded).
*** Issue 27790 has been marked as a duplicate of this issue. ***
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).
Created attachment 7898 [details] CPU profiling snapshot - firts opening with warm-up preinitialization
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).
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.
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
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
Please focus on this primarily for M3, issue 28595 should help.
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.