Momentjs cached format functions (v4)

Revision 4 of this benchmark created on


Preparation HTML

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

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

<script>
if (window.console) {
console.log('moment162', moment162().format('dddd, MMMM Do YYYY, h:mm:ss a'));
console.log('moment', moment().format('dddd, MMMM Do YYYY, h:mm:ss a'));

console.log('moment162', moment162().format('LLLL'));
console.log('moment', moment().format('LLLL'));
}
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
normal long
moment162().format('dddd, MMMM Do YYYY, h:mm:ss a');
ready
cached long
moment().format('dddd, MMMM Do YYYY, h:mm:ss a');
ready
normal small
moment162().format('MM-DD-YYYY');
ready
cached small
moment().format('MM-DD-YYYY');
ready
normal local
moment162().format('LLLL');
ready
cached local
moment().format('LLLL');
ready

Revisions

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