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 120442 - 20 sec delay when samples jsps are edited
Summary: 20 sec delay when samples jsps are edited
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Marek Fukala
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2007-10-30 09:51 UTC by Petr Blaha
Modified: 2008-09-18 15:41 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
thread dump (17.34 KB, text/plain)
2007-10-30 09:51 UTC, Petr Blaha
Details
There are some interesting thread dumps during the first change after first start of the IDE. (91.60 KB, text/plain)
2007-10-30 17:16 UTC, Petr Pisl
Details
new thread dump (25.89 KB, text/plain)
2007-10-30 17:59 UTC, Petr Blaha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Blaha 2007-10-30 09:51:26 UTC
Product Version: NetBeans IDE Dev (Build 071029)
Java: 1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105
System: Linux version 2.6.17-12-generic running on i386; UTF-8; en_US (nb)

Steps:
1) start IDE with new userdir
2) register Tomcat
3) create New Project - Samples - Web - JSP Examples
4) open some jsp
5) try to edit it
ERROR: it takes aprox. 20 sec when the cursor is visible in editor
thread dumpm attached.
Comment 1 Petr Blaha 2007-10-30 09:51:55 UTC
Created attachment 51974 [details]
thread dump
Comment 2 Petr Blaha 2007-10-30 12:03:57 UTC
The issue is reproducible in NB 6.0.
Comment 3 Petr Blaha 2007-10-30 15:58:36 UTC
Assign to correct component.
Comment 4 Marek Fukala 2007-10-30 16:00:51 UTC
But there is nothing interesting going on in the attached threaddumpl. Can you try make another one please?
Comment 5 Petr Pisl 2007-10-30 17:14:57 UTC
This is reproducible. I think it's connected with the fresh userdir. It really takes more than 15 seconds during first
jsp modification. The processor during this time is used for 100%. When I restart the ide then doesn't work perfect, the
first changed after second start takes about 3 seconds, but is much better then after first start. 
Comment 6 Petr Pisl 2007-10-30 17:16:14 UTC
Created attachment 52026 [details]
There are some interesting thread dumps during the first change after first start of the IDE.
Comment 7 Petr Blaha 2007-10-30 17:59:21 UTC
Created attachment 52032 [details]
new thread dump
Comment 8 Marek Fukala 2007-10-30 18:06:25 UTC
The time is spent mainly in Schlieman languages initialization - see following part of the stack - Mila Lexer calls
Language.embedding for all possible tokens of the language to determine all possible language paths for the document.
For those which are Schlieman's the LanguagesManager.initLanguage() is called and since they are initialized for the
first time the initialization itself including dynamic mime lookup registration takes a lot of time. So briefly - after
the file edit JSP, EL, HTML, CSS, JAVASCRIPT languages are initialized. Except EL all are more or less handled by Schlieman.

        at org.netbeans.modules.languages.LanguagesManager.initLanguage(LanguagesManager.java:284)
        at org.netbeans.modules.languages.LanguagesManager.getLanguage(LanguagesManager.java:161)
        - locked <0x9139a478> (a org.netbeans.modules.languages.LanguagesManager)
        at org.netbeans.modules.languages.lexer.SLanguageProvider.findLanguage(SLanguageProvider.java:74)
        at org.netbeans.lib.lexer.LanguageManager.findLanguage(LanguageManager.java:140)
        - locked <0x91cb7c98> (a java.lang.String)
        at org.netbeans.api.lexer.Language.find(Language.java:163)
        at org.netbeans.api.html.lexer.HTMLTokenId$1.embedding(HTMLTokenId.java:141)
        at org.netbeans.spi.lexer.LanguageHierarchy$Accessor.embedding(LanguageHierarchy.java:380)
Comment 9 Jan Jancura 2007-10-30 19:55:40 UTC
Reproducible. 
JavaScript and CSS nbs file are not initialized, when user opens simple JSP file without any CSS, JavaScript embedded.
First initialization of these two languages can be long. So I have optimized initialization of these languages.
The rest of fix should be done in JSP editor implementation. Marku, can you force initialization of CSS and JavaScript,
before you open JSP? Call:
LanguagesManager.get ("text/css") and LanguagesManager.get ("text/javascript") please.

IDE:-------------------------------------------------
IDE: [10/30/07 8:21 PM] Committing "CSS Editor Support" started
cvs server: scheduling file `FontAndColorsInlinedCSS.xml' for addition
cvs server: scheduling file `FontAndColors.xml' for addition
cvs server: use 'cvs commit' to add these files permanently
RCS file: /cvs/languages/css/src/org/netbeans/modules/languages/css/FontAndColors.xml,v
done
Checking in FontAndColors.xml;
/cvs/languages/css/src/org/netbeans/modules/languages/css/FontAndColors.xml,v  <--  FontAndColors.xml
initial revision: 1.1
done
RCS file: /cvs/languages/css/src/org/netbeans/modules/languages/css/FontAndColorsInlinedCSS.xml,v
done
Checking in FontAndColorsInlinedCSS.xml;
/cvs/languages/css/src/org/netbeans/modules/languages/css/FontAndColorsInlinedCSS.xml,v  <--  FontAndColorsInlinedCSS.xml
initial revision: 1.1
done
Checking in layer.xml;
/cvs/languages/css/src/org/netbeans/modules/languages/css/layer.xml,v  <--  layer.xml
new revision: 1.10; previous revision: 1.9
done
Checking in Bundle.properties;
/cvs/languages/css/src/org/netbeans/modules/languages/css/Bundle.properties,v  <--  Bundle.properties
new revision: 1.15; previous revision: 1.14
done
IDE: [10/30/07 8:21 PM] Committing "CSS Editor Support" finished

IDE:-------------------------------------------------
IDE: [10/30/07 8:21 PM] Committing "resources" started
cvs server: scheduling file `FontAndColors.xml' for addition
cvs server: use 'cvs commit' to add this file permanently
Checking in Bundle.properties;
/cvs/languages/engine/src/org/netbeans/modules/languages/resources/Bundle.properties,v  <--  Bundle.properties
new revision: 1.7; previous revision: 1.6
done
RCS file: /cvs/languages/engine/src/org/netbeans/modules/languages/resources/FontAndColors.xml,v
done
Checking in FontAndColors.xml;
/cvs/languages/engine/src/org/netbeans/modules/languages/resources/FontAndColors.xml,v  <--  FontAndColors.xml
initial revision: 1.1
done
Checking in layer.xml;
/cvs/languages/engine/src/org/netbeans/modules/languages/resources/layer.xml,v  <--  layer.xml
new revision: 1.15; previous revision: 1.14
done
IDE: [10/30/07 8:21 PM] Committing "resources" finished

IDE:-------------------------------------------------
IDE: [10/30/07 8:21 PM] Committing "layer.xml" started
Checking in layer.xml;
/cvs/html/editor/src/org/netbeans/modules/html/editor/resources/layer.xml,v  <--  layer.xml
new revision: 1.21; previous revision: 1.20
done
IDE: [10/30/07 8:21 PM] Committing "layer.xml" finished

IDE:-------------------------------------------------
IDE: [10/30/07 8:22 PM] Committing "javascript" started
cvs server: scheduling file `FontAndColors.xml' for addition
cvs server: scheduling file `FontAndColorsJSON.xml' for addition
cvs server: scheduling file `FontAndColorsString.xml' for addition
cvs server: use 'cvs commit' to add these files permanently
RCS file: /cvs/scripting/javascript/src/org/netbeans/modules/languages/javascript/FontAndColors.xml,v
done
Checking in FontAndColors.xml;
/cvs/scripting/javascript/src/org/netbeans/modules/languages/javascript/FontAndColors.xml,v  <--  FontAndColors.xml
initial revision: 1.1
done
RCS file: /cvs/scripting/javascript/src/org/netbeans/modules/languages/javascript/FontAndColorsJSON.xml,v
done
Checking in FontAndColorsJSON.xml;
/cvs/scripting/javascript/src/org/netbeans/modules/languages/javascript/FontAndColorsJSON.xml,v  <--  FontAndColorsJSON.xml
initial revision: 1.1
done
RCS file: /cvs/scripting/javascript/src/org/netbeans/modules/languages/javascript/FontAndColorsString.xml,v
done
Checking in FontAndColorsString.xml;
/cvs/scripting/javascript/src/org/netbeans/modules/languages/javascript/FontAndColorsString.xml,v  <-- 
FontAndColorsString.xml
initial revision: 1.1
done
Checking in Bundle.properties;
/cvs/scripting/javascript/src/org/netbeans/modules/languages/javascript/Bundle.properties,v  <--  Bundle.properties
new revision: 1.18; previous revision: 1.17
done
Checking in layer.xml;
/cvs/scripting/javascript/src/org/netbeans/modules/languages/javascript/layer.xml,v  <--  layer.xml
new revision: 1.24; previous revision: 1.23
done
IDE: [10/30/07 8:22 PM] Committing "javascript" finished

IDE:-------------------------------------------------
IDE: [10/30/07 8:22 PM] Committing "layer.xml" started
Checking in layer.xml;
/cvs/web/jspsyntax/src/org/netbeans/modules/web/core/syntax/resources/layer.xml,v  <--  layer.xml
new revision: 1.31; previous revision: 1.30
done
IDE: [10/30/07 8:22 PM] Committing "layer.xml" finished

IDE:-------------------------------------------------
IDE: [10/30/07 8:22 PM] Committing "YAML Editor Support" started
cvs server: scheduling file `FontAndColors.xml' for addition
cvs server: use 'cvs commit' to add this file permanently
Checking in Bundle.properties;
/cvs/languages/yaml/src/org/netbeans/modules/languages/yaml/Bundle.properties,v  <--  Bundle.properties
new revision: 1.6; previous revision: 1.5
done
Checking in layer.xml;
/cvs/languages/yaml/src/org/netbeans/modules/languages/yaml/layer.xml,v  <--  layer.xml
new revision: 1.9; previous revision: 1.8
done
RCS file: /cvs/languages/yaml/src/org/netbeans/modules/languages/yaml/FontAndColors.xml,v
done
Checking in FontAndColors.xml;
/cvs/languages/yaml/src/org/netbeans/modules/languages/yaml/FontAndColors.xml,v  <--  FontAndColors.xml
initial revision: 1.1
done
IDE: [10/30/07 8:22 PM] Committing "YAML Editor Support" finished
Comment 10 Marek Fukala 2007-10-30 22:15:30 UTC
I'll try to put it to the jsp editor warm up task, but before that I'll check how much faster is the initialization
after your migration of the features to the static layer files. Thanks for the fast fix!!!
Comment 11 Petr Jiricka 2007-10-30 23:13:32 UTC
If this needs to be appied to JSP, should a similar fix be also applied to RHTML?
Comment 12 Marek Fukala 2007-10-31 16:14:10 UTC
added to the JspWarmUpTask, seems to be  faster then. Maybe Tor could do the same for RHTML.

Checking in JspEditorWarmUpTask.java;
/cvs/web/core/src/org/netbeans/modules/web/core/JspEditorWarmUpTask.java,v  <--  JspEditorWarmUpTask.java
new revision: 1.9; previous revision: 1.8
done
Comment 13 josin 2008-09-18 15:41:58 UTC
Seems to be fixed. Verified.

Product Version: NetBeans IDE Dev (Build 200809180201)
Java: 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b11
System: Linux version 2.6.24-19-generic running on i386; UTF-8; en_US (nb)