Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipse-incubator-e4-dev] Avoiding Bloat

> So how could we bring all this to the world of Java. I hacked together
> some test code which uses Proxy.newProxyInstance to find out big the
> performance impact is going to be (Code is attached as a zip to this mail).
>
> To test performance I implemented 4 cases:
> a) Interface is backed up by a ResourceBundle
> b) Interface is backed up by an NLSClass which itself implements the
>    Interface
> c) Interface is backed up by an NLSClass which itself does not
>    implement the Interface
> d) Traditional NLSClass (like we all use NLS in todays bundles) where
>    fields are access.
>
> [snip]
>
> The figures are like this:
>
> Resource-Bundle: : 1000000 took 112 => 1.12E-4
> NLS-With-Interface: : 1000000 took 8 => 8.0E-6
> NLS-Without-Interface: : 1000000 took 1247 => 0.001247
> Traditional: 1000000 took 3 => 3.0E-6
>
> So for 1.000.000 calls we have a performance penalty of 5 ms.

Would you be able to compare the four approaches in terms of memory consumption (as a function of how many interfaces, and how many strings) as well? One of the main reasons for the current design (static fields) was memory overhead.

Boris


Back to the top