Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Date.toLocaleDateString
Comparing 2 dates with Date.toLocaleDateString() vs using Date.get* methods
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
without toLocaleDateString
72589240.0 Ops/sec
with toLocaleDateString
812109.8 Ops/sec
Script Preparation code:
var x = new Date('5/11/2018'); var y = new Date('5/11/2018');
Tests:
without toLocaleDateString
var z = (x.getFullYear() === y.getFullYear() && x.getMonth() === y.getMonth() && x.getDate() === y.getDate());
with toLocaleDateString
var z = (x.toLocaleDateString('en-US') === y.toLocaleDateString('en-US'));