Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
parseInt vs Number // toString vs String
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
parseInt
884295.3 Ops/sec
Number
939837.4 Ops/sec
toString
6382647.0 Ops/sec
String
947344.0 Ops/sec
Script Preparation code:
var numbers = [1, 12, 123, 1234, 12345, 123456, 1234567, 12345678, 123456789]; var strNumbers = ["1", "12", "123", "1234", "12345", "123456", "1234567", "12345678", "123456789"];
Tests:
parseInt
strNumbers.forEach(n => parseInt(n));
Number
strNumbers.forEach(n => Number(n));
toString
numbers.forEach(n => n.toString());
String
numbers.forEach(n => String(n));