[Vm-dev] Integer comparition primitive failures on Cog
Henrik Sperre Johansen
henrik.s.johansen at veloxit.no
Mon May 2 10:12:14 UTC 2011
As per my comment on the recent Morphic performance
graphs,(http://blog.openinworld.com/2011/03/morphic-flavour-performance/#comment-59)
on a Cog VM these primitives fail with a Float parameter, which leads to
a huge performance hit when comparing Ints to Floats by doing silly
things in the fallback code.
Cog:
[1 to: 2000000 do: [:i |
i < 2354.234.
i <= 2354.234.
i >= 2354.234.
i > 2354.234.]] timeToRun 26594
Trunk:
[1 to: 2000000 do: [:i |
i < 2354.234.
i <= 2354.234.
i >= 2354.234.
i > 2354.234.]] timeToRun 229
Should this be changed in the VM, or is the difference for pure int/int
comparition large enough that we should instead change
Float>>adaptToInteger: andCompare:
to use the corresponding comparitions with Float as receiver, which does
work?
That's still slower than trunk in my image, but quite a bit better,
above test takes about 1s.
Cheers,
Henry
More information about the Vm-dev
mailing list