commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Nokleberg <>
Subject Re: [primitives] Design decisions
Date Tue, 02 Sep 2003 18:48:30 GMT
Stephen Colebourne wrote:
> 4) How much to code generate
>  a) None (!)
>  b) All
>  c) All classes, but not interfaces
> I prefer (c) at present, as I think it will simplify CVS (only interfaces
> present).

I expect you are assuming build-time generation, but you may want to
consider run-time generation as well. As an example, the CGLIB
ParallelSorter class uses a common sorting algorithm coded in Java, with
just the "swap" portion replaced by primitive-type-specific code generated
at runtime:

The disadvantage with static code generation is that you balloon your jar
file with all the variants (IntDoubleMap, LongLongMap, etc.) and you may
still not end up covering every permutation.


View raw message