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.
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...
Logged In: YES
user_id=402164
Originator: NO
together with that, we should implement cache
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).
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.