All,
Simone and I have started working on cometd 2.0, which is a refactor of the
code base of cometd1.0 with the two purposes of:
+ cleaning up dead end ideas that hang over from the development of
cometd and bayeux
+ to support websocket and other new transports.
So I think I've just proved that I'm and idiot, which in turn proves
that I'm not an idiot!
I think my ImmutableHashMap implementation was not correctly recycling
the ImmutableHashMaps. I've now written both an ImmutableMessage
and a HashMapMessage implementation and the benchmark now shows that
the pooled ImmutableMessage is about 35% faster than just using HashMap
plus it provides an enforced immutable interface!
So I don't think all my object creation phobia is that outdated after all!
Simone, can you double check this benchmark (checked in as MessageBenchmark)
thanks
So I think I've just proved that I'm and idiot, which in turn proves
that I'm not an idiot!
On Mon, Dec 21, 2009 at 07:06, Greg Wilkins <gr...@intalio.com> wrote:
>
>
> So I think I've just proved that I'm and idiot, which in turn proves
> that I'm not an idiot!
>
> I think my ImmutableHashMap implementation was not correctly recycling
> the ImmutableHashMaps. I've now written both an ImmutableMessage
> and a HashMapMessage implementation and the benchmark now shows that
> the pooled ImmutableMessage is about 35% faster than just using HashMap
> plus it provides an enforced immutable interface!
>
> So I don't think all my object creation phobia is that outdated after all!
>
> Simone, can you double check this benchmark (checked in as MessageBenchmark)
Erhm...
In that test class I see that you use HashMaps in
immutableMessageTest(), and pooled ImmutableMessages in
hashMessageTest() - should be the opposite, no ?
I see a 40% gain, but following the code it's the HashMap that gains
on the ImmutableMessage...
Can you triple check ?