18 May 2004 16:06
Re: Timings for the new version of Closure
On 18 May 2004, at 14:53, John Wilson wrote:
> On 18 May 2004, at 14:43, Michael Campbell wrote:
>> John Wilson wrote:
>>> It's just occurred to me that I'm including the loop overhead in
>> the
>>> timings. I've measure the time to do an empty loop and it's 300
>>> milliseconds!
>>>
>>> So the numbers I posted originally have to be reduces by 300 (both
>>> versions)
>>
>>
>> Excellent. When you say "... faster than calling a method ..." is
>> this because of the dynamic dispatch?
>>
>
> Yes,
>
> a closure is an optimisable special case. Although one of the tricks
> I used to optimise zero, one and two parameter closure calls could
> possibly be used on normal classes. I need to think a little more
> about this...
Absolutely. I tried to optimise the zero-argument method calls a little
while ago (can't remember how far I got but I think I did it). We could
optimise method-calls-with-one-arg some (to avoid creating redundant
Object[] { arg } objects though its a little harder.
James
-------
http://radio.weblogs.com/0112098/
RSS Feed