Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
IPv4 number to dotted decimal
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
bitwise shift
35597024.0 Ops/sec
pow function
2179213.0 Ops/sec
Bitwise shift string concat
39328624.0 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
let num = 3232235777;
Tests:
bitwise shift
const octet1 = (num >>> 24) & 255; const octet2 = (num >>> 16) & 255; const octet3 = (num >>> 8) & 255; const octet4 = num & 255; return `${octet1}.${octet2}.${octet3}.${octet4}`;
pow function
const octet1 = Math.floor(num / Math.pow(256, 3)); num = num % Math.pow(256, 3); const octet2 = Math.floor(num / Math.pow(256, 2)); num = num % Math.pow(256, 2); const octet3 = Math.floor(num / Math.pow(256, 1)); num = num % Math.pow(256, 1); const octet4 = num; return `${octet1}.${octet2}.${octet3}.${octet4}`;
Bitwise shift string concat
const octet1 = (num >>> 24) & 255; const octet2 = (num >>> 16) & 255; const octet3 = (num >>> 8) & 255; const octet4 = num & 255; return octet1 + '.' + octet2 + '.' + octet3 + '.' + octet4;
Bitwise shift string concat no variables
return ((num >>> 24) & 255).toString() + '.' + ((num >>> 16) & 255).toString() + '.' + ((num >>> 8) & 255).toString() + '.' + (num & 255).toString();