FAQ

[Velocity-dev] [jira] [Commented] (VELOCITY-812) Parser.jj_scan_token very slow during debugging

Anonymous
Sep 20, 2011 at 4:28 pm
[ https://issues.apache.org/jira/browse/VELOCITY-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13108810#comment-13108810 ]

Konstantinos Kougios commented on VELOCITY-812:
-----------------------------------------------

this occurs within eclipse, every time I start tomcat on debugging mode

PID: 22031
Host: localhost
Main class: org.codehaus.plexus.classworlds.launcher.Launcher
JVM: Java HotSpot(TM) 64-Bit Server VM (21.0-b17, mixed mode)
Java: version 1.7.0, vendor Oracle Corporation
JVM Flags: <none>


-agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:52078
-Xmx512m
-XX:MaxPermSize=256m

Parser.jj_scan_token very slow during debugging
-----------------------------------------------

Key: VELOCITY-812
URL: https://issues.apache.org/jira/browse/VELOCITY-812
Project: Velocity
Issue Type: Bug
Components: Engine
Affects Versions: 1.7
Environment: linux, windows, tomcat 6 running via maven, JDK7 (but had same issue with JDK6)
Reporter: Konstantinos Kougios

Parser.jj_scan_token runs very slowly during java debugging mode. I've allocated more than enough memory for Java (Xmx , Xss, PermGen) and made sure it is enough by monitoring via visualvm.
I am working on a springframework mvc project, with velocity as the template engine. Spring has a macro file that is loaded during startup : spring.vm (10kb). My box (6 core phenom processor) takes 10 seconds to parse that macro. After profiling with visualvm, I found out that 9 secs are spend on jj_scan_token method.
When running the project without debugging enabled, the parsing is very fast.
Please note that the issue occurs without any customization of velocity properties. Typically though the properties look like this:
springMacro.resource.loader.cache=true,
resource.loader=[springMacro],
velocimacro.library=org/springframework/web/servlet/view/velocity/spring.vm,
output.encoding=UTF-8,
input.encoding=UTF-8,
springMacro.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
Please note that I've tried removing the encoding, but still the problem persists.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
reply

Search Discussions

8 responses

  • Anonymous at Sep 21, 2011 at 3:45 pm
    [ https://issues.apache.org/jira/browse/VELOCITY-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13109586#comment-13109586 ]

    Konstantinos Kougios commented on VELOCITY-812:
    -----------------------------------------------

    maybe because an exception is thrown from this method and this exception is used for normal control flow?

    if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;

    probably during debugging the jvm is not very optimised regarding exceptions.
    Parser.jj_scan_token very slow during debugging
    -----------------------------------------------

    Key: VELOCITY-812
    URL: https://issues.apache.org/jira/browse/VELOCITY-812
    Project: Velocity
    Issue Type: Bug
    Components: Engine
    Affects Versions: 1.7
    Environment: linux, windows, tomcat 6 running via maven, JDK7 (but had same issue with JDK6)
    Reporter: Konstantinos Kougios

    Parser.jj_scan_token runs very slowly during java debugging mode. I've allocated more than enough memory for Java (Xmx , Xss, PermGen) and made sure it is enough by monitoring via visualvm.
    I am working on a springframework mvc project, with velocity as the template engine. Spring has a macro file that is loaded during startup : spring.vm (10kb). My box (6 core phenom processor) takes 10 seconds to parse that macro. After profiling with visualvm, I found out that 9 secs are spend on jj_scan_token method.
    When running the project without debugging enabled, the parsing is very fast.
    Please note that the issue occurs without any customization of velocity properties. Typically though the properties look like this:
    springMacro.resource.loader.cache=true,
    resource.loader=[springMacro],
    velocimacro.library=org/springframework/web/servlet/view/velocity/spring.vm,
    output.encoding=UTF-8,
    input.encoding=UTF-8,
    springMacro.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
    Please note that I've tried removing the encoding, but still the problem persists.
    --
    This message is automatically generated by JIRA.
    For more information on JIRA, see: http://www.atlassian.com/software/jira



    ---------------------------------------------------------------------
    To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
    For additional commands, e-mail: dev-help@velocity.apache.org
  • Anonymous at Sep 21, 2011 at 3:51 pm
    [ https://issues.apache.org/jira/browse/VELOCITY-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13109594#comment-13109594 ]

    Nathan Bubna commented on VELOCITY-812:
    ---------------------------------------

    Just to be sure you know, that code is pretty much all generated by JavaCC. You might try building Velocity with the latest JavaCC version to see if that helps. We are not going to be applying any patches or fixes directly to generated code, as that is unmaintainable for us.
    Parser.jj_scan_token very slow during debugging
    -----------------------------------------------

    Key: VELOCITY-812
    URL: https://issues.apache.org/jira/browse/VELOCITY-812
    Project: Velocity
    Issue Type: Bug
    Components: Engine
    Affects Versions: 1.7
    Environment: linux, windows, tomcat 6 running via maven, JDK7 (but had same issue with JDK6)
    Reporter: Konstantinos Kougios
    Attachments: profile.png


    Parser.jj_scan_token runs very slowly during java debugging mode. I've allocated more than enough memory for Java (Xmx , Xss, PermGen) and made sure it is enough by monitoring via visualvm.
    I am working on a springframework mvc project, with velocity as the template engine. Spring has a macro file that is loaded during startup : spring.vm (10kb). My box (6 core phenom processor) takes 10 seconds to parse that macro. After profiling with visualvm, I found out that 9 secs are spend on jj_scan_token method.
    When running the project without debugging enabled, the parsing is very fast.
    Please note that the issue occurs without any customization of velocity properties. Typically though the properties look like this:
    springMacro.resource.loader.cache=true,
    resource.loader=[springMacro],
    velocimacro.library=org/springframework/web/servlet/view/velocity/spring.vm,
    output.encoding=UTF-8,
    input.encoding=UTF-8,
    springMacro.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
    Please note that I've tried removing the encoding, but still the problem persists.
    --
    This message is automatically generated by JIRA.
    For more information on JIRA, see: http://www.atlassian.com/software/jira



    ---------------------------------------------------------------------
    To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
    For additional commands, e-mail: dev-help@velocity.apache.org
  • Anonymous at Sep 21, 2011 at 3:51 pm
    [ https://issues.apache.org/jira/browse/VELOCITY-812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Konstantinos Kougios updated VELOCITY-812:
    ------------------------------------------

    Attachment: profile.png

    profiling with jvisualvm
    Parser.jj_scan_token very slow during debugging
    -----------------------------------------------

    Key: VELOCITY-812
    URL: https://issues.apache.org/jira/browse/VELOCITY-812
    Project: Velocity
    Issue Type: Bug
    Components: Engine
    Affects Versions: 1.7
    Environment: linux, windows, tomcat 6 running via maven, JDK7 (but had same issue with JDK6)
    Reporter: Konstantinos Kougios
    Attachments: profile.png


    Parser.jj_scan_token runs very slowly during java debugging mode. I've allocated more than enough memory for Java (Xmx , Xss, PermGen) and made sure it is enough by monitoring via visualvm.
    I am working on a springframework mvc project, with velocity as the template engine. Spring has a macro file that is loaded during startup : spring.vm (10kb). My box (6 core phenom processor) takes 10 seconds to parse that macro. After profiling with visualvm, I found out that 9 secs are spend on jj_scan_token method.
    When running the project without debugging enabled, the parsing is very fast.
    Please note that the issue occurs without any customization of velocity properties. Typically though the properties look like this:
    springMacro.resource.loader.cache=true,
    resource.loader=[springMacro],
    velocimacro.library=org/springframework/web/servlet/view/velocity/spring.vm,
    output.encoding=UTF-8,
    input.encoding=UTF-8,
    springMacro.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
    Please note that I've tried removing the encoding, but still the problem persists.
    --
    This message is automatically generated by JIRA.
    For more information on JIRA, see: http://www.atlassian.com/software/jira



    ---------------------------------------------------------------------
    To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
    For additional commands, e-mail: dev-help@velocity.apache.org
  • Anonymous at Sep 21, 2011 at 4:15 pm
    [ https://issues.apache.org/jira/browse/VELOCITY-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13109616#comment-13109616 ]

    Konstantinos Kougios commented on VELOCITY-812:
    -----------------------------------------------

    just compiled the parser by using javacc v5 and running
    ant -Djavacc.home=..../javacc-5.0 parser

    The Parser class contains the same line of code that throws an exception (used as control structure and not as a real error)

    I tried to give it a go anyway, but velocity doesn't compile, JJParserState is not generated by javacc anymore:

    mvn clean -DskipTests=true package
    ...
    [ERROR] /home/ariskk/temp/t/1.7/src/java/org/apache/velocity/runtime/parser/JJTParserState.java:[5,25] error: cannot find symbol
    [ERROR] class JJTParserState
    [ERROR] /home/ariskk/temp/t/1.7/src/java/org/apache/velocity/runtime/parser/JJTParserState.java:[37,9] error: cannot find symbol
    [ERROR] class JJTParserState
    [ERROR] /home/ariskk/temp/t/1.7/src/java/org/apache/velocity/runtime/parser/JJTParserState.java:[42,23] error: cannot find symbol
    [ERROR] class JJTParserState
    ...



    Parser.jj_scan_token very slow during debugging
    -----------------------------------------------

    Key: VELOCITY-812
    URL: https://issues.apache.org/jira/browse/VELOCITY-812
    Project: Velocity
    Issue Type: Bug
    Components: Engine
    Affects Versions: 1.7
    Environment: linux, windows, tomcat 6 running via maven, JDK7 (but had same issue with JDK6)
    Reporter: Konstantinos Kougios
    Attachments: profile.png


    Parser.jj_scan_token runs very slowly during java debugging mode. I've allocated more than enough memory for Java (Xmx , Xss, PermGen) and made sure it is enough by monitoring via visualvm.
    I am working on a springframework mvc project, with velocity as the template engine. Spring has a macro file that is loaded during startup : spring.vm (10kb). My box (6 core phenom processor) takes 10 seconds to parse that macro. After profiling with visualvm, I found out that 9 secs are spend on jj_scan_token method.
    When running the project without debugging enabled, the parsing is very fast.
    Please note that the issue occurs without any customization of velocity properties. Typically though the properties look like this:
    springMacro.resource.loader.cache=true,
    resource.loader=[springMacro],
    velocimacro.library=org/springframework/web/servlet/view/velocity/spring.vm,
    output.encoding=UTF-8,
    input.encoding=UTF-8,
    springMacro.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
    Please note that I've tried removing the encoding, but still the problem persists.
    --
    This message is automatically generated by JIRA.
    For more information on JIRA, see: http://www.atlassian.com/software/jira



    ---------------------------------------------------------------------
    To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
    For additional commands, e-mail: dev-help@velocity.apache.org
  • Anonymous at Sep 21, 2011 at 4:46 pm
    [ https://issues.apache.org/jira/browse/VELOCITY-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13109642#comment-13109642 ]

    Nathan Bubna commented on VELOCITY-812:
    ---------------------------------------

    hmm. not generated at all? or perhaps ends up in the wrong package?
    Parser.jj_scan_token very slow during debugging
    -----------------------------------------------

    Key: VELOCITY-812
    URL: https://issues.apache.org/jira/browse/VELOCITY-812
    Project: Velocity
    Issue Type: Bug
    Components: Engine
    Affects Versions: 1.7
    Environment: linux, windows, tomcat 6 running via maven, JDK7 (but had same issue with JDK6)
    Reporter: Konstantinos Kougios
    Attachments: profile.png


    Parser.jj_scan_token runs very slowly during java debugging mode. I've allocated more than enough memory for Java (Xmx , Xss, PermGen) and made sure it is enough by monitoring via visualvm.
    I am working on a springframework mvc project, with velocity as the template engine. Spring has a macro file that is loaded during startup : spring.vm (10kb). My box (6 core phenom processor) takes 10 seconds to parse that macro. After profiling with visualvm, I found out that 9 secs are spend on jj_scan_token method.
    When running the project without debugging enabled, the parsing is very fast.
    Please note that the issue occurs without any customization of velocity properties. Typically though the properties look like this:
    springMacro.resource.loader.cache=true,
    resource.loader=[springMacro],
    velocimacro.library=org/springframework/web/servlet/view/velocity/spring.vm,
    output.encoding=UTF-8,
    input.encoding=UTF-8,
    springMacro.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
    Please note that I've tried removing the encoding, but still the problem persists.
    --
    This message is automatically generated by JIRA.
    For more information on JIRA, see: http://www.atlassian.com/software/jira



    ---------------------------------------------------------------------
    To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
    For additional commands, e-mail: dev-help@velocity.apache.org
  • Anonymous at Sep 22, 2011 at 8:53 am
    [ https://issues.apache.org/jira/browse/VELOCITY-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13112419#comment-13112419 ]

    Konstantinos Kougios commented on VELOCITY-812:
    -----------------------------------------------

    the error is weird as it can't find the JJTParserState within.... JJTParserState!

    What I did is I removed all javacc generated files from org.apache.velocity.runtime.parser . (I left Parser.jj and VelocityCharStream). Then run

    ant -Djavacc.home=..../javacc-5.0 parser

    which recreated the javacc source files. Then I did
    mvn clean package

    and I am getting these errors

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project velocity: Compilation failure: Compilation failure:
    [ERROR] /home/ariskk/temp/t/1.7/src/java/org/apache/velocity/runtime/parser/JJTParserState.java:[5,25] error: cannot find symbol
    [ERROR] class JJTParserState
    [ERROR] /home/ariskk/temp/t/1.7/src/java/org/apache/velocity/runtime/parser/JJTParserState.java:[37,9] error: cannot find symbol
    [ERROR] class JJTParserState
    ....
    Parser.jj_scan_token very slow during debugging
    -----------------------------------------------

    Key: VELOCITY-812
    URL: https://issues.apache.org/jira/browse/VELOCITY-812
    Project: Velocity
    Issue Type: Bug
    Components: Engine
    Affects Versions: 1.7
    Environment: linux, windows, tomcat 6 running via maven, JDK7 (but had same issue with JDK6)
    Reporter: Konstantinos Kougios
    Attachments: profile.png


    Parser.jj_scan_token runs very slowly during java debugging mode. I've allocated more than enough memory for Java (Xmx , Xss, PermGen) and made sure it is enough by monitoring via visualvm.
    I am working on a springframework mvc project, with velocity as the template engine. Spring has a macro file that is loaded during startup : spring.vm (10kb). My box (6 core phenom processor) takes 10 seconds to parse that macro. After profiling with visualvm, I found out that 9 secs are spend on jj_scan_token method.
    When running the project without debugging enabled, the parsing is very fast.
    Please note that the issue occurs without any customization of velocity properties. Typically though the properties look like this:
    springMacro.resource.loader.cache=true,
    resource.loader=[springMacro],
    velocimacro.library=org/springframework/web/servlet/view/velocity/spring.vm,
    output.encoding=UTF-8,
    input.encoding=UTF-8,
    springMacro.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
    Please note that I've tried removing the encoding, but still the problem persists.
    --
    This message is automatically generated by JIRA.
    For more information on JIRA, see: http://www.atlassian.com/software/jira



    ---------------------------------------------------------------------
    To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
    For additional commands, e-mail: dev-help@velocity.apache.org
  • Anonymous at Sep 22, 2011 at 8:55 am
    [ https://issues.apache.org/jira/browse/VELOCITY-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13112419#comment-13112419 ]

    Konstantinos Kougios edited comment on VELOCITY-812 at 9/22/11 8:54 AM:
    ------------------------------------------------------------------------

    It is in the correct package, org.apache.velocity.runtime.parser

    the error is weird as it can't find the JJTParserState within.... JJTParserState!

    What I did is I removed all javacc generated files from org.apache.velocity.runtime.parser . (I left Parser.jj and VelocityCharStream). Then run

    ant -Djavacc.home=..../javacc-5.0 parser

    which recreated the javacc source files. Then I did
    mvn clean package

    and I am getting these errors

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project velocity: Compilation failure: Compilation failure:
    [ERROR] /home/ariskk/temp/t/1.7/src/java/org/apache/velocity/runtime/parser/JJTParserState.java:[5,25] error: cannot find symbol
    [ERROR] class JJTParserState
    [ERROR] /home/ariskk/temp/t/1.7/src/java/org/apache/velocity/runtime/parser/JJTParserState.java:[37,9] error: cannot find symbol
    [ERROR] class JJTParserState
    ....

    was (Author: ariskk):
    the error is weird as it can't find the JJTParserState within.... JJTParserState!

    What I did is I removed all javacc generated files from org.apache.velocity.runtime.parser . (I left Parser.jj and VelocityCharStream). Then run

    ant -Djavacc.home=..../javacc-5.0 parser

    which recreated the javacc source files. Then I did
    mvn clean package

    and I am getting these errors

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project velocity: Compilation failure: Compilation failure:
    [ERROR] /home/ariskk/temp/t/1.7/src/java/org/apache/velocity/runtime/parser/JJTParserState.java:[5,25] error: cannot find symbol
    [ERROR] class JJTParserState
    [ERROR] /home/ariskk/temp/t/1.7/src/java/org/apache/velocity/runtime/parser/JJTParserState.java:[37,9] error: cannot find symbol
    [ERROR] class JJTParserState
    ....
    Parser.jj_scan_token very slow during debugging
    -----------------------------------------------

    Key: VELOCITY-812
    URL: https://issues.apache.org/jira/browse/VELOCITY-812
    Project: Velocity
    Issue Type: Bug
    Components: Engine
    Affects Versions: 1.7
    Environment: linux, windows, tomcat 6 running via maven, JDK7 (but had same issue with JDK6)
    Reporter: Konstantinos Kougios
    Attachments: profile.png


    Parser.jj_scan_token runs very slowly during java debugging mode. I've allocated more than enough memory for Java (Xmx , Xss, PermGen) and made sure it is enough by monitoring via visualvm.
    I am working on a springframework mvc project, with velocity as the template engine. Spring has a macro file that is loaded during startup : spring.vm (10kb). My box (6 core phenom processor) takes 10 seconds to parse that macro. After profiling with visualvm, I found out that 9 secs are spend on jj_scan_token method.
    When running the project without debugging enabled, the parsing is very fast.
    Please note that the issue occurs without any customization of velocity properties. Typically though the properties look like this:
    springMacro.resource.loader.cache=true,
    resource.loader=[springMacro],
    velocimacro.library=org/springframework/web/servlet/view/velocity/spring.vm,
    output.encoding=UTF-8,
    input.encoding=UTF-8,
    springMacro.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
    Please note that I've tried removing the encoding, but still the problem persists.
    --
    This message is automatically generated by JIRA.
    For more information on JIRA, see: http://www.atlassian.com/software/jira



    ---------------------------------------------------------------------
    To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
    For additional commands, e-mail: dev-help@velocity.apache.org
  • Anonymous at Sep 22, 2011 at 9:03 am
    [ https://issues.apache.org/jira/browse/VELOCITY-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13112422#comment-13112422 ]

    Konstantinos Kougios commented on VELOCITY-812:
    -----------------------------------------------

    just had a look at the velocity svn trunk, the code that throws the exception for control flow is still there at Parser.java . I suppose if javacc don't change their generated code, the slowdown in debugging mode will persist.
    Parser.jj_scan_token very slow during debugging
    -----------------------------------------------

    Key: VELOCITY-812
    URL: https://issues.apache.org/jira/browse/VELOCITY-812
    Project: Velocity
    Issue Type: Bug
    Components: Engine
    Affects Versions: 1.7
    Environment: linux, windows, tomcat 6 running via maven, JDK7 (but had same issue with JDK6)
    Reporter: Konstantinos Kougios
    Attachments: profile.png


    Parser.jj_scan_token runs very slowly during java debugging mode. I've allocated more than enough memory for Java (Xmx , Xss, PermGen) and made sure it is enough by monitoring via visualvm.
    I am working on a springframework mvc project, with velocity as the template engine. Spring has a macro file that is loaded during startup : spring.vm (10kb). My box (6 core phenom processor) takes 10 seconds to parse that macro. After profiling with visualvm, I found out that 9 secs are spend on jj_scan_token method.
    When running the project without debugging enabled, the parsing is very fast.
    Please note that the issue occurs without any customization of velocity properties. Typically though the properties look like this:
    springMacro.resource.loader.cache=true,
    resource.loader=[springMacro],
    velocimacro.library=org/springframework/web/servlet/view/velocity/spring.vm,
    output.encoding=UTF-8,
    input.encoding=UTF-8,
    springMacro.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
    Please note that I've tried removing the encoding, but still the problem persists.
    --
    This message is automatically generated by JIRA.
    For more information on JIRA, see: http://www.atlassian.com/software/jira



    ---------------------------------------------------------------------
    To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
    For additional commands, e-mail: dev-help@velocity.apache.org

Related Discussions

Discussion Navigation
viewthread | post

1 user in discussion

Anonymous: 9 posts