Skip to content
Permalink
Browse files

Fixed the build/speed testing application to work with current versio…

…ns of jQuery. The main changes were implementing :has() where necessary to replace functionality that no longer existed and to use noConflict() so the libraries wouldn't have to be modified for the speed testing.

So now the file jquery-basis.js will be tested against the jquery.js in the /dist directory. Version 1.2.1 is currently in jquery-basis.js.
  • Loading branch information
davids549 committed Dec 5, 2007
1 parent 2da897d commit b0b5fa74b6790ad18504c063f2ffcc1beb52916a
Showing with 5,998 additions and 2,255 deletions.
  1. +7 −6 build/speed/benchmarker.js
  2. +7 −4 build/speed/index.html
  3. +0 −2,245 build/speed/jquery-1.1.2.js
  4. +2,992 −0 build/speed/jquery-1.2.1.js
  5. +2,992 −0 build/speed/jquery-basis.js
@@ -20,8 +20,8 @@
jQuery(this).parent().children("*:gt(1)").remove();
} catch(e) { }
})
var times = 5;
jQuery("#times").html(times);
// set # times to run the test in index.html
var times = parseInt(jQuery("#times").val());
jQuery.benchmarker.startingList = this.get();
benchmark(this.get(), times, jQuery.benchmarker.libraries);
}
@@ -33,10 +33,10 @@
jQuery("tbody tr:first-child").remove();
jQuery("td.test").before("<td><input type='checkbox' checked='checked' /></td>");
jQuery("button.runTests").bind("click", function() {
jQuery('td[input:checked] + td.test').benchmark();
jQuery('td:has(input:checked) + td.test').benchmark();
});

jQuery("button.retryTies").bind("click", function() { jQuery("tr[td.tie] td.test").benchmark() })
jQuery("button.retryTies").bind("click", function() { jQuery("tr:has(td.tie) td.test").benchmark() })

jQuery("button.selectAll").bind("click", function() { jQuery("input[@type=checkbox]").each(function() { this.checked = true }) })
jQuery("button.deselectAll").bind("click", function() { jQuery("input[@type=checkbox]").each(function() { this.checked = false }) })
@@ -52,8 +52,9 @@
})
})

var headers = jQuery.map(jQuery.benchmarker.libraries, function(i) {
return "<th>" + i + "</th>"
var headers = jQuery.map(jQuery.benchmarker.libraries, function(i,n) {
var extra = n == 0 ? "basis - " : "";
return "<th>" + extra + i + "</th>"
}).join("");

jQuery("thead tr").append(headers);
@@ -5,8 +5,11 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Speed Test</title>
<script src="../dist/jquery.js" type="text/javascript"></script>
<script src="jquery-1.1.2.js" type="text/javascript"></script>
<script src="jquery-basis.js" type="text/javascript"></script>
<script src="../../dist/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery.noConflict();
</script>
<link rel="stylesheet" href="benchmarker.css" type="text/css" media="screen" />
</head>

@@ -15,7 +18,7 @@
<h1>Speed Test</h1>
<div id="badid"></div>
<div id="time-test">
<p>Using the following selector expressions (<span id="times">5</span> times each):</p>
<p>Using the following selector expressions (<input type="text" id="times" maxlength="5" size="5" value="20"/> times each):</p>
<p>NOTE: Number shown is an average.</p>
<div class="buttons">
<button class="selectAll">Select All</button>
@@ -502,7 +505,7 @@ <h3>ACT I, SCENE III. A room in the palace.</h3>
</div>
</div>
<script type="text/javascript" charset="utf-8">
jQuery.benchmarker = {libraries: ["jQOld", "jQuery"]};
jQuery.benchmarker = {libraries: ["$", "jQuery"]};
</script>

<script src="benchmarker.js"></script>

0 comments on commit b0b5fa7

Please sign in to comment.
You can’t perform that action at this time.