Gavin King

Results 1171 comments of Gavin King

I will make a start on this by taking a stab at reimplementing `Whole` in Ceylon based on an `Array`, since that doesn't look terribly daunting.

Awesome! Sent from my iPhone > On 04 Dec 2014, at 05:34, John Vasileff [email protected] wrote: > > I started on an implementation of Whole, and although it still needs...

> Is there a good reason to keep Whole (and Decimal) as interfaces No, not AFAIK. > Separately, once constructors are available, are there any opinions on using constructors vs....

Wow I did not expect that. Sounds to good to be true, but if it is true, that's excellent news! Sent from my iPhone > On 08 Dec 2014, at...

You're using `ArrayList`, not `Array`?

I wonder if we used something like this as its internal state: ``` Integer i0; Integer i1; Integer[] is; Integer get(Integer loc) => switch (loc) case (0) i0 case (1)...

@jvasileff Be careful: retrieving an element from an `Array` boxes the primitive int. > java.util.ArrayList performs about 12x better Note that the VM itself has hacked-in optimizations for `java.util.ArrayList`. We...

@jvasileff Oh wait, you're using `List.get()` not `List.getFromFirst()`. In microbenchmarks `getFromFirst()` is _much_ faster because it avoids boxing the index!

But yeah, even after making that change, I get much better performance in this microbenchmark with `LinkedList` than with `Array` or `ArrayList`.