Coercion vs Casting (v22)

Revision 22 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Coercion
~~+'2.9'-1
ready
Casting
Math.floor(parseInt('2.9') - 1)
ready
Bitshift
('2.9' >> 0) - 1
ready
Calc it
~~'2.9'-1
ready
Calc then cast
~~('2.9'-1)
ready
Casting no floor
parseInt('2.9') - 1
ready
Casting no floor with radix
parseInt('2.9', 10) - 1
ready

Revisions

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