Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Chrome 109
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
jQuery 3.6.0 250734.2 Ops/sec
jQuery 3.2.1 266791.2 Ops/sec
HTML Preparation code:
AخA
 
1
<script src='https://code.jquery.com/jquery-3.6.0.js'></script>
2
<script type="text/javascript">
3
  var jq331 = $.noConflict(true);
4
</script>
5
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js'></script>
6
<script type="text/javascript">
7
  var jq214 = $.noConflict(true);
8
</script>
9
<div id="testElement"></div>
Tests:
  • jQuery 3.6.0

     
    var element = jq331('#testElement');
    element.removeClass('test-class');
    element.addClass('test-class');
    element.removeClass('test-class');
  • jQuery 3.2.1

     
    var element = jq214('#testElement');
    element.removeClass('test-class');
    element.addClass('test-class');
    element.removeClass('test-class');