[Vm-dev] Performance of primitiveFailFor: and use of primFailCode

Igor Stasenko siguctua at gmail.com
Tue May 24 08:46:02 UTC 2011


>
> No mistake, the performance problem was real.
>
> Good news - I found the cause. Better news - this may be good for a
> performance boost on StackVM and possibly Cog also.
>
> The performance hit was due almost entirely to InterpreterPrimitives>>failed,
> and perhaps a little bit to #successful and #success: also.
>
> This issue with #failed is due to "^primFailCode ~= 0" which, for purposes
> of C translation, can be recoded as "^primFailCode" with an override in
> the simulator as "^primFailCode ~= 0". This produces a significant speed
> improvement, at least as fast as for the original interpreter implementation
> using successFlag.
>
> I expect that the same change applied to StackInterpreter may give a similar
> 10% improvement (though I have not tried it). I don't know what to expect
> with Cog, but it may give a boost there as well.
>
> Changes attached, also included in VMMaker-dtl.237 on SqueakSource.
>
> Dave
>
>
>

added to http://code.google.com/p/cog/issues/detail?id=45

it is strange that such small detail  could make a lot of difference in speed.

-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Vm-dev mailing list