Momentjs cached format functions
JavaScript performance comparison
Preparation code
<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>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
normal long |
|
pending… |
cached long |
|
pending… |
normal small |
|
pending… |
cached small |
|
pending… |
normal local |
|
pending… |
cached local |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published by Tim Wood
0 comments