Langarth

JavaScript performance comparison

Test case created

Preparation code

<ul id="main_nav">
  <li>
    <a href="#" id="mission_nav" title="View the Langarth mission" style="color: rgb(156, 165, 174);">Mission.</a>
  </li>
  <li>
    <a href="#" id="guarantee_nav" title="View the Langarth guarantee" style="color: rgb(156, 165, 174);">Guarantee.</a>
  </li>
  <li>
    <a href="#" id="understand_nav" title="Langarth want to understand our customer goals"
   style="color: rgb(67, 90, 104);">Understand.</a>
  </li>
  <li>
    <a href="#" id="define_nav" title="Langarth will help you define your brand" style="color: rgb(156, 165, 174);">Define.</a>
  </li>
  <li>
    <a href="#" id="promote_nav" title="Langarth will work with you to help you promote your company"
   style="color: rgb(156, 165, 174);">Promote.</a>
  </li>
  <li>
    <a href="#" id="contact_nav" title="Contact Langarth about working with you." style="color: rgb(156, 165, 174);">Contact.</a>
  </li>
</ul>
<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
Delegate 1
$('#main_nav').on('click', 'a', function(e) {
  e.preventDefault();
  var _el = e.target.id;
});
pending…
Delegate 2
$('#main_nav').on('click', 'li a', function(e) {
  e.preventDefault();
  var _el = e.target.id;
});
pending…
Cache 1
var $nav = $('#main_nav')
$nav.on('click', 'li a', function(e) {
  e.preventDefault();
  var _el = e.target.id;
});
pending…
Cache 2
var $nav = $('#main_nav')
$nav.on('click', 'a', function(e) {
  e.preventDefault();
  var _el = e.target.id;
});
pending…
CSS test 1
$('#main_nav a').css('color', function() {
  //
});
pending…
CSS test 2
$('a', '#main_nav').css('color', function() {
  //
});
pending…
CSS test 3
$('#main_nav').find('a').css('color', function() {
  //
});
pending…
CSS test 4
var $nav1 = $('#main_nav')

$nav1.find('a').css('color', function() {
  //
});
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