Date parsing speed

JavaScript performance comparison

Revision 2 of this test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var s = '2012-12-20';
    var m = 61316780400000;
};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
New Date
var date = new Date(s);
return date.getFullYear() + date.getMonth() + date.getDate();
pending…
String Parse and Date Conversion
var date = parseInt(s.replace('-', ''));
pending…
from milliseconds
var date = Date(m);
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:

0 comments

Add a comment