PA Olympics Performance Test - JSONP vs JSON Parsing

JavaScript performance comparison

Test case created by Adhip Gupta

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
 

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
JSONP
// async test
$.ajax({
  url: "http://olympics.api.press.net/olympics/2012-summer-olympics/schedule/2012-08-01?apikey=cavqhm8vh443fkenekqpsw7u",
  dataType: "jsonp",
  jsonpCallback: "jsPerfTest",
  success: function(response) {
    console.log(response);
    deferred.resolve();
  }
});
pending…
JSON
// async test
$.ajax({
  url: "http://olympics.api.press.net/olympics/2012-summer-olympics/schedule/2012-08-01?apikey=cavqhm8vh443fkenekqpsw7u",
  dataType: "json",
  headers: {
    "Accept": "application/json"
  },
  success: function(response) {
    console.log(response);
    deferred.resolve();
  }
});
pending…

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

Compare results of other browsers

0 comments

Add a comment