Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
new Intl.DateTimeFormat vs no new Intl.DateTimeFormat
measure the perf impact of caching calls to new Intl.DateTimeFormat
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/135.0.0.0 Safari/537.36
Browser:
Chrome 135
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
new Intl.DateTimeFormat.format()
23574.4 Ops/sec
Intl.DateTimeFormat.format()
23315.7 Ops/sec
new Intl.DateTimeFormat.formatToParts
22933.4 Ops/sec
Intl.DateTimeFormat.formatToParts
22187.3 Ops/sec
Script Preparation code:
const TWO_DIGIT = '2-digit'; var options = { month: TWO_DIGIT, year: 'numeric', day: TWO_DIGIT, hour: TWO_DIGIT, hour12: false, minute: TWO_DIGIT, second: TWO_DIGIT, } var cached = new Intl.DateTimeFormat('en-US', options);
Tests:
new Intl.DateTimeFormat.format()
new Intl.DateTimeFormat('en-US', options).format(new Date());
Intl.DateTimeFormat.format()
Intl.DateTimeFormat('en-US', options).format(new Date());
new Intl.DateTimeFormat.formatToParts
new Intl.DateTimeFormat('en-US', options).formatToParts(new Date());
Intl.DateTimeFormat.formatToParts
Intl.DateTimeFormat('en-US', options).formatToParts(new Date());