ParseFloat vs x1 vs Number

Benchmark created on


Description

Benchmarking various methods of converting a string to a float.

Setup

var MIN_SCALE = 916 / 2700;

Test runner

Ready to run.

Testing in
TestOps/sec
Times 1
MIN_SCALE = MIN_SCALE.toFixed(12) * 1;
ready
ParseFloat
MIN_SCALE = parseFloat(MIN_SCALE.toFixed(12));
ready
Number
MIN_SCALE = Number(MIN_SCALE.toFixed(12));
ready

Revisions

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