Hi zbo,
As mentioned above, there is some amount of boiler plate code that does get
included in your GWT application when using the RootPanel and other
associated widgets. Once this boiler plate is in place though, the rest of
your application reuses it and the curve plotting code size versus number of
lines of code starts flattening out.

That said, using standard GWT widgets is ideal when you are on your way to
build a fairly large Ajax application. However, if you're instead planning
on developing a small scale application that will have some Ajax features,
you should probably look into using GWT at a lower level (i.e. using the DOM
API). At that level, you can only code exactly what you need for your
application while still having the benefit of automatic cross-browser
support and strong typing.

DOM API:
http://code.google.com/webtoolkit/doc/1.6/DevGuideUserInterface.html#DevGuideAccessingDOM

Hope that helps,
-Sumit Chandel

On Mon, Apr 27, 2009 at 12:02 AM, Jason Morris <[email protected]> wrote:

>
> Actually HashMap and many of the Collections classes /are/ used in that
> simple bit on code.
>
> The Widget classes and Event management make heavy use of the Collections
> classes. RootPanel alone
> uses a HashMap, and HashSet (which in turn use AbstractSet, etc.),
> RootPanel also uses the Window
> class with uses ArrayList and Collections.
>
> So basically by using RootPanel.get().add() you've effectively made use of
> a large chunk of the
> Collections classes, parts of the Event system, etc.
>
> The compiler is fairly good at removing unused code, but theres only so far
> it can go. The fact is:
> in a fairly complex GWT application you're likely to be using that code
> anyways.
>
> I assume you're compressing your compiled code before shipping it out to
> the browser, and setting
> the cache headers correctly, since once the user has the code (the .cache.*
> files) they never need
> to download them again (the name will change if the content of the file is
> changed).
>
> Hope that explains the behavior a bit ;)
> // J
>
> Vitali Lovich wrote:
> > The GWT compiler is supposed to remove all unused code.  If you believe
> > that there's code in there that is unused, or can be removed, I would
> > recommend filing a bug.  Hopefully a GWT developer would be able to
> > provide more information about this particular question.
> >
> > On Sun, Apr 26, 2009 at 5:03 PM, zbo <[email protected]
> > <mailto:[email protected]>> wrote:
> >
> >
> >     Hello,
> >
> >       I am working on reducing the compiled js size of a relatively
> >     complex GWT application.  I've been looking at the detailed output of
> >     the compile process, and find quite a few blocks of code that seem to
> >     be included no matter what.  To test things and get a better
> >     understanding of the GWT compile process, I build a trivial GWT app:
> >
> >        onModuleLoad() {
> >            RootPanel.get().add(new Label("placeholder");
> >        }
> >
> >      Detailed output of this app was approximately 105k in size, and
> >     filled with code I would expect (management of GWTEvents, onLoad
> >     methods, String handling, etc) but also a lot of code that I wouldn't
> >     expect (Hashmap, HashSet, AbstractSet, Set, Collections, etc.)  My
> >     question - is this entirely necessary, and if not, how do I avoid
> >     having all of this code included a final compile of a real app?
> >
> >     -Z
> >
> >
> >
> >
> > >
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to