Closure compiler integration

35 views
Skip to first unread message

Paul Stockley

unread,
Dec 22, 2011, 11:12:43 AM12/22/11
to google-we...@googlegroups.com
I can see there is some work going on to integrate the closure compiler as a back end to the GWT compiler. Apparently this can give a 20% code reduction. I am curious why such a big decrease. GWT and the closure compiler seem to do very similar optimizations so why is the closure compiler so much better? 

Alan Leung

unread,
Dec 22, 2011, 6:00:05 PM12/22/11
to google-we...@googlegroups.com

Apparently this can give a 20% code reduction. I am curious why such a big decrease.

It varies.
 
GWT and the closure compiler seem to do very similar optimizations

No. I would say both compilers are very different.

GWT does a fantastic job at the Java level. It leverages the Java type system very well to perform a lot of optimization that Closure Compiler developers can only dream of due to the dynamic nature of Javascript. The GWT team spends a lot of time making sure the compiler generate optimized code that mimics Java behaviors. That has also been the biggest win.

On the other hand Closure Compiler team focuses on raw Javascript size. The developers spends countless hours looking at compressed Javascript and ways to squeeze a few kilobytes here and there until it adds up.

-Alan
 

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/z6L0mOMIBi4J.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Reply all
Reply to author
Forward
0 new messages