Thursday, July 10, 2014

Re: IE8 application performs better in dev mode than under compiled mode

In the meantime though, I'm just frustrated by the fact that I get the performance I want when running in DEV mode, but not when it's compiled. I'd like to understand is happening in DEV mode that is different from compiled that improve performance. Ultimately, the GWT Plugin is serving up javascript to IE8 to render, correct? It's just compiling that javascript on the fly from the java code. What's different about the javascript being generated by the plugin from the javascript genereted by the compiler?

Well while in DevMode your Java code is executed inside your JVM and not inside the browser as JavaScript. The only thing the browser directly executes are JSNI calls as they represent native JavaScript calls. What makes DevMode slow are calls to JavaScript which must go through the browser plugin. Some GWT SDK classes have optimizations to run faster in DevMode by avoiding to ask the browser to execute JavaScript. For example you can have something like

if(GWT.isScript()) {
  // choose implementation that is fast when compiled to JS because it uses lots of JSNI and native JavaScript features
} else {
  // choose implementation that can run in pure JVM to avoid calls to the browser plugin which cost lots of time in DevMode.
}

Because you are using IE 8 which isn't the fastest browser it is not surprising that some parts of GWT are faster in DevMode for you simply because they are not executed in the browser but instead in the JVM.

-- J.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment