John
--
You've received this message because you've subscribed to the Gaelyk Google Group.
To send an email to the group, please write to: gae...@googlegroups.com
To unsuscribe from this group: gaelyk+un...@googlegroups.com
To show more options: http://groups.google.fr/group/gaelyk?hl=en
On Tue, Feb 14, 2012 at 01:18, John <jwb...@gmail.com> wrote:
> Thanks very much, Guillaume!
>
> We're still trying to figure out the circumstances that correlate with a
> slow load. It may be related to compiling the script for the first time, but
> without explicit logging, it's not easy to track which appengine instances
> have already compiled a given script. We don't observe this slowness in the
> development server; it seems unlikely that the route dispatching would be so
> dramatically slower on AppEngine. That's why I became concerned that
> GroovyScriptEngine looks like it's causing the script resource to be opened
> even if it has already been compiled.
>
> I became concerned that the GroovyScriptEngine could be trying to read the
> script on each call because it looks like Groovy's
> AbstractHttpServlet.getResourceConnection will be used each time the script
> is referenced, and that calls openConnection if the
> servletContext.getContext returns non-null.
>
> Since I don't see anything doing logging in this area, it's not clear what's
> occasionally slow. It would be nice to have log entries when the
> GroovyScriptEngine compiles a script (cache-miss), and also logging to
> indicate how long it takes to compute isSourceNewer(), since this loops
> through dependencies seeming to open each one.
>
> Is there an easy way to set the CompilerConfig used by the
> GroovyScriptEngine?
The GroovyScriptEngine used in the GroovyServlet (extended by
GaelykServlet) is private, but Groovy allows you to access such
private information if needed. And then, on the GroovyScriptEngine,
there's a getter to get the CompilerConfiguration.
A bit cleaner would be to extend GroovyServlet to override the
createGroovyScriptEngine() method to provide your own, or simply to
keep track of it so you can access it more easily.
> I'm curious whether changing the
> CompilerConfig.minimumCompilationInterval to 48.hours might reduce the delay
> we observe since that would (effectively) avoid the opening of the
> referenced classes: it appears the DEFAULT object provides a value of 100ms
> for this.
There's a bug in the reloading of GroovyScriptEngine that may very
well come into play.
But it's not been properly fixed yet, as it's a bit tricky.
Perhaps it's related to that, but I'm not sure.
> Maybe I'll see about putting some logging in at the level of GaelykServlet
> and see what can be manipulated from that point. Is there any
> guidance/examples for appropriate logging that would help me to put add it
> in a way that would make it easier to pull into a future version?
The GroovyScriptEngine doesn't have any logging, but the GroovyServlet
is using the servlet context logger.
Guillaume