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

Revision 30 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('2011-09-23T20:40:55.999+0000');
    var preExistingMoment = moment(preExisting);

Test runner

Ready to run.

Testing in
TestOps/sec
Date
new Date('2011-09-23T20:40:55.999+0000');
ready
Moment.js via string
moment('2011-09-23T20:40:55.999+0000');
ready
Moment.js via Date
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.