Date vs Moment.js with(out) format vs cloned (v33)

Revision 33 of this benchmark created by Matt on


Description

Checking the speed of Moment.js with different options.

Preparation HTML

<script src="http://momentjs.com/downloads/moment.min.js"></script>

Setup

var preExisting = new Date('2014-02-23T01:02-05:00');
    var preExistingMoment = moment(preExisting);

Test runner

Ready to run.

Testing in
TestOps/sec
Date
new Date('2014-02-23T01:02-05:00');
ready
Moment.js without format
moment('2014-02-23T01:02-05:00','YYYY-MM-DD\\THH:mm:ssZ');
ready
Moment.js with format
moment(preExisting);
ready
Moment.js cloned
preExistingMoment.clone();
ready

Revisions

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