Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
unaryPlus vs parseInt vs Number addition
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Unary Plus
6267930.5 Ops/sec
parseInt
3704869.2 Ops/sec
Number
3680550.2 Ops/sec
TildTild
6278680.0 Ops/sec
Script Preparation code:
var intA = "42.034"; var strB = "42.034";
Tests:
Unary Plus
var res = +intA + +strB;
parseInt
var res = parseInt(intA) + parseInt(strB);
Number
var res = Number(intA) + Number(strB);
TildTild
var res = ~~intA + ~~strB;