Float to Int conversion comparison (v18)

Revision 18 of this benchmark created by Singmyr 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)
ready
shift
(Math.random() * 1000) >> 0
ready
shift more
(Math.random() * 1000) >>> 0
ready
modulo
n = (Math.random() * 1000)
n - n % 1
ready

Revisions

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