Menu

#108 Compile and cache compiled JavaScript

closed
None
5
2012-10-21
2007-05-10
No

We have a performance issue with HtmlUnit due to the large JavaScript libraries that we use. This could potentially be solved by compiling JavaScript that is stored in separate .js files once, and using this compiled version whenever the same .js file is encountered.

Discussion

  • Daniel Gredler

    Daniel Gredler - 2007-05-10

    Logged In: YES
    user_id=1109422
    Originator: NO

    Interesting suggestion. Have you performed any profiling in order to verify your theory? I did some profiling not too long ago, but compilation did not seem to be an issue...

     
  • Marc Guillemot

    Marc Guillemot - 2007-09-06

    Logged In: YES
    user_id=402164
    Originator: NO

    together with that, we should implement cache

     
  • Marc Guillemot

    Marc Guillemot - 2007-10-16

    Logged In: YES
    user_id=402164
    Originator: NO

    First step is now implemented: JS server responses are cached.

    Next I want to cache the parsed Script instances (not compiled because compiling introduce new limitations and is probably not needed in the case of HtmlUnit).

     
  • Marc Guillemot

    Marc Guillemot - 2007-12-03

    Logged In: YES
    user_id=402164
    Originator: NO

    Now implemented in SVN.

    Parsed scripts are now cached as long as the corresponding WebResponse is itself cached. To be 100% precise, scripts are not compiled as HtmlUnit uses OptimizationLevel -1 to get better information on errors but this shouldn't really matter as typical js processing in html code is rather short.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.