Date vs Moment.js with(out) format (v23)

Revision 23 of this benchmark created on


Description

Checking the speed of Moment.js with different options.

Preparation HTML

<script src="https://rawgithub.com/timrwood/moment/2.0.0/moment.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
Date
for (var i = 0, len = 1000; i < len; i++) {     
    Date.parse('2011-09-23T20:40:55.' + i + '+0000').toString(); 
};
ready
Moment.js without format
for (var i = 0, len = 1000; i < len; i++) { 
    moment('2011-09-23T20:40:55.' + i + '+0000').toString(); 
};
ready
Moment.js with format
for (var i = 0, len = 1000; i < len; i++) { 
    moment('2011-09-23T20:40:55.' + i + '+0000',"YYYY-MM-DDTHH:mm:ss.SSS").toString(); 
};
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.