xhr.responseType="json"

JavaScript performance comparison

Test case created by Eric Bidelman

Info

Comparison of xhr.responseType="json" vs. JSON.parse();

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
JSON.parse()
// async test
var xhr = new XMLHttpRequest();
xhr.open('GET', 'http://www.chromestatus.com/features.json');
xhr.onload = function(e) {
  var json = JSON.parse(e.target.response);
  deferred.resolve();
};
xhr.send();
pending…
responseType="json"
// async test
var xhr = new XMLHttpRequest();
xhr.open('GET', 'http://www.chromestatus.com/features.json');
xhr.responseType = "json";
xhr.onload = function(e) {
  deferred.resolve();
};
xhr.send();
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