jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
var nmFormat = /^(((0|128|192|224|240|248|252|254).0.0.0)|(255.(0|128|192|224|240|248|252|254).0.0)|(255.255.(0|128|192|224|240|248|252|254).0)|(255.255.255.(0|128|192|224|240|248|252|254)))$/;
var masks = [
0b11111111,
0b11111110,
0b11111100,
0b11111000,
0b11110000,
0b11100000,
0b11000000,
0b10000000,
0b00000000
];
var data = [
'255.255.255.255',
'255.255.255.128'
'255.255.255.192',
'255.255.255.0',
'255.255.255.224',
'255.255.0.0',
'255.0.0.0',
'0.0.0.0',
]
function validNetmask(netmask) {
var parts = ip.split('.').map(x => parseInt(x, 10));
return parts.length === 4 && parts.every(x => x.includes(parseInt(x, 10)))
}
funciton validNetmaskRegex(netmask) {
return nmFormat.test(netmask);
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Regex |
| ready |
Mask |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.