Print

Print


On Sat, 22 Oct 2005, Harri Salakoski wrote:

> Just to clarify that I ported my branch of ecj wich is several years old
> branch. As much ecj is framework it benefits 1.5 template feature more
> than average java code. Other hand templates don't help much in low
> level optimizations like when using integers or raw bytes and I had
> difficulties with those. There is however
> "autocapsulation"(Integer->int) feature in 1.5 but I have no glue it
> performance, I however ported to one ListGenome<T> in vectors package
> for example. Some of genetic operations still stayed separate per/type.

When Sun said they were going to add generics to Java, I thought that'd be
a great idea.  ECJ's biggest ugliness is in its vector package, where we
have vectors for numerous data types.  But then they decided to go the
cheapo route and add generics only as syntactic sugar, and worse, if you
wanted generics for basic types, they had to be boxed (which is enormously
expensive).

The difference in speed between ArrayList<int> and array[int] is
unbelievable.  :-(  Sun really *really* screwed up with generics IMHO.
There was already a good generics package out there that handled this
properly, but they rolled their own and blew it.

So, sadly, I've decided not to use the generics in the vector package.
That and the fact that ECJ tries hard to be backward-compatible with
earlier Java versions (even now, Version 13 is compatible with Java 1.2).

Sean