HTML Preparation code:
AخA
 
1
<script src='https://code.jquery.com/jquery-3.6.0.min.js'></script>
Tests:
  • jQuery test case

     
    $.ajax({
      type: 'POST',
      url: "http://vanilla-js.com/path/to/api",
      data: {'banana': 'yellow'},
      success: (data) = {},
    });
  • Vanilla JS test case

    x
     
    const sendAjax = (url, data, callback) => {
        fetch(url, {
            method: 'POST',
            body: new URLSearchParams(data),
        }).then((response) => {
            const contentType = response.headers.get("content-type");
            if (contentType && contentType.indexOf("application/json") !== -1) {
                return response.json().then(data => {callback(data)});
            } else {
                return response.text().then(text => {callback(text)});
            }
        });
    }
    sendAjax('http://vanilla-js.com/path/to/api', {'banana': 'yellow'}, (data) => {});
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    jQuery test case
    Vanilla JS test case

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 11 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Chrome 135 on Windows
View result in a separate tab
Test name Executions per second
jQuery test case 9749.3 Ops/sec
Vanilla JS test case 14242.0 Ops/sec