Momentjs cached format functions

Benchmark created by Tim Wood on


Preparation HTML

<script src="https://raw.github.com/timrwood/moment/1.6.2/moment.js"></script>
<script>
window.moment162 = moment;
</script>

<script src="https://raw.github.com/timrwood/moment/b098adf2325bd62b1ca42debb7287492d7874a3e/moment.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.