Native XHR vs jQuery ajax (v27)

Revision 27 of this benchmark created by Alphonze on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
Native XHR
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
  if (xhr.readyState == 4) {
    //done
  }
}
xhr.open("GET", "http://jsperf.com", true);
xhr.send(null);
ready
jQuery ajax
var request = $.ajax({
    type: "GET",
    url: "http://jsperf.com",
    success: function() { },
    data: null
});
ready

Revisions

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