Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
unescape vs replace function
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0
Browser:
Firefox 122
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
unescape
20K/s
replace func
4K/s
View exact numbers
Test name
Executions per second
✓
unescape
19,668 Ops/sec
replace func
3,622 Ops/sec
Script Preparation code:
var count = 1000;
Tests:
unescape
for (var i = 0; i < count; i++) { unescape(encodeURI("日")); }
replace func
for (var i = 0; i < count; i++) { encodeURI("日").replace(/%[\da-f]{2}/gi, (char) => String.fromCodePoint(parseInt(char.replace(/%/, ""), 16))); }