Float to Int conversion comparison (v9)

Revision 9 of this benchmark created by ! on


Test runner

Ready to run.

Testing in
TestOps/sec
Bitwise OR
(Math.random() * 1000) | 0;
ready
Bitwise NOT
~~(Math.random() * 1000)
ready
Math.floor
Math.floor(Math.random() * 1000)
ready
parseInt
parseInt(Math.random() * 1000, 10)
ready
<< 0
(Math.random() * 1000) << 0
ready
^ 0
(Math.random() * 1000) ^ 0
ready
Math.round
Math.round(Math.random() * 1000)
ready
>> 0
(Math.random() * 1000) >> 0
ready
>>> 0
(Math.random() * 1000) >>> 0
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.