Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
moment vs date-fns
It's not a deep validation; I'm just comparing ONE function that those two libraries have in common.
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0
Browser:
Firefox 132
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
moment
83929.6 Ops/sec
date-fns
90812.7 Ops/sec
HTML Preparation code:
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/date-fns/1.30.1/date_fns.min.js"></script>
Script Preparation code:
window.__date__ = new Date(); window.__expected__ = '2000/01/06';
Tests:
moment
var actual = moment(__date__).format('YYYY/MM/DD'); console.assert(actual === __expected__);
date-fns
var actual = dateFns.format(__date__, 'YYYY/MM/DD'); console.assert(actual === __expected__);