Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
luxon-v-Intl-v-datefns format, luxon-v-Date-v-datefns native parse
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Browser:
Chrome 127
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
moment/luxon - format
288845.5 Ops/sec
Intl - format
362642.2 Ops/sec
moment/luxon - parse
643490.1 Ops/sec
Native parse
3270618.5 Ops/sec
date-fns (old) format
267378.3 Ops/sec
date-fns (old) parse
1225483.2 Ops/sec
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/luxon@2.0.2/build/global/luxon.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/date-fns/1.29.0/date_fns.min.js"></script>
Script Preparation code:
window.__dateISO__ = '2021-09-24T07:36:51+0000' window.__date__ = new Date(__dateISO__); window.__expected__ = '09/24/2021'; window.__intlFormatter = new Intl.DateTimeFormat('en', { year: '2-digit', month: '2-digit', day: '2-digit', });
Tests:
moment/luxon - format
var actual = luxon.DateTime.fromJSDate(__date__).toLocaleString(); console.assert(actual === __expected__);
Intl - format
var actual = window.__intlFormatter.format(__date__); console.assert(actual === __expected__);
moment/luxon - parse
var actual = luxon.DateTime.fromISO(__dateISO__).toJSDate(); console.assert(__date__.getTime() === actual.getTime());
Native parse
var actual = new Date(__dateISO__); console.assert(__date__.getTime() === actual.getTime());
date-fns (old) format
var actual = dateFns.format(__date__); console.assert(actual === __expected__);
date-fns (old) parse
var actual = dateFns.parse(__dateISO__); console.assert(__date__.getTime() === actual.getTime());