2008/10/27 Gili <[EMAIL PROTECTED]>
>
> Just as a side-note, why has Guice 2.0 gotten so fat? Guice 1.0 was
> 540k. Guice 2.0 is 950k. Seems a bit excessive for a DI framework. If
> Guice was my only dependency I wouldn't worry so much but this is part
> of a growing pattern, the total of all my dependencies has grown into
> the multi-megabytes. This makes life difficult for desktop
> applications...
>
most of the extra bytes has come from pulling in google collections,
if I change build.xml to remove this then guice core is around 486k
I don't know if this is because guice uses most of the collections lib,
or perhaps jarjar isn't able to remove the unused classes because of
inter-dependencies, but it does end up embedding most classes...
ps. if I remove cglib from build.xml it drops down to ~359k, which
means we're only using 127k from the cglib library (overall 272k)
and with no embedded dependencies guice core is only 314k
so, in summary:
314k core
45k asm
127k cglib
439k collections
====
925k guice
This discussion is somewhat related to unbundling CGLIB from Guice
> because my project already has it as an external dependency.
well, the figures show removing CGLIB wouldn't make much difference
because guice uses less than half of the jar - in fact removing it would
actually increase the footprint for people who don't use it elsewhere,
as they'd have to load the whole CGLIB jar.
the major win would be if we could trim down the collections classes
And surprisingly, CGLIB is itself a fat library compared to ASM... ASM
> does a lot of difficult work compared to CGLIB which makes you wonder
> why the latter is 3x larger!
>
actually providing a proxy framework is not as easy as you might think,
especially wrt. analyzing classes, etc. - and while ASM does reduce the
workload, you still need a lot of calls to ASM to generate classes, etc.
so I'm not that surprised it's larger (and if you see anything in CGLIB
that could be trimmed down, then I'm sure they'd be happy to fix it)
Gili
>
> On Oct 24, 2:30 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> > I've tagged a new snapshot and uploaded new binaries for a new
> > prerelease. This is an unpolished early version of Guice 2. In
> > addition to some fixing some v1 bugs, this snapshot includes early
> > versions of the new SPI, provider methods, multibindings, child
> > injectors, and private modules. The .zip includes the guice jar,
> > extension jars, javadoc, and source jars:
> >
> > http://google-guice.googlecode.com/files/guice-snapshot20081016.zip
> >
> > --
> >
> > browse source:
> http://code.google.com/p/google-guice/source/browse/tags/snapshot2008...
> > download source:
> http://google-guice.googlecode.com/files/guice-snapshot20081016-src.zip
> > v2 overview:http://code.google.com/p/google-guice/wiki/Guice2
> > v2 bugs:
> http://code.google.com/p/google-guice/issues/list?q=label:Milestone-R...
> >
> > Disclaimer: The APIs in this snapshot will change before Guice 2.0
> > final is released. There are known bugs in the release. But it is safe
> > to use (and we're using it internally).
> >
>
--
Cheers, Stuart
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"google-guice" 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-guice?hl=en
-~----------~----~----~----~------~----~------~--~---