Closed Bug 707635 Opened 13 years ago Closed 13 years ago

Number->Atom about 4x faster than float->atom

Categories

(Tamarin Graveyard :: Virtual Machine, defect, P3)

x86
macOS
defect

Tracking

(Not tracked)

VERIFIED INVALID
Q2 12 - Cyril

People

(Reporter: lhansen, Unassigned)

References

Details

I'm attaching a simple benchmark.  On my Mac Pro, R-D 32-bit build with -Dnodebugger from TR-float 6999, the loop f1() runs in 476ms, the loop f2() in 102ms.  The core of each loop is a conversion from float and Number, respectively, to atom.  This suggests that floatToAtom needs more work.
Virgil notes the following in email:

"I beg to differ: floatToAtom can’t be faster (if I remember it correctly).

If my memory serves me right, doubleToAtoom_SSE2 will be faster indeed – but only when the Atom turns out to be an integer. We don’t have the luxury to encode ANY float value as an atom, we allocate each time."
Indeed when the data are non-integers, the two loops run the same speed.
Closing as invalid - fact of life until we have different representations.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.