Skip to content
Permalink
Browse files

Adding a simple file for doing .css() performance testing.

  • Loading branch information...
jeresig committed Sep 17, 2010
1 parent 8691a82 commit 9dd70a44ad682e7b9aa66680c54a38789a116e27
Showing with 4,447 additions and 2,534 deletions.
  1. +49 −0 speed/css.html
  2. +4,398 −2,534 speed/jquery-basis.js
@@ -0,0 +1,49 @@
<!doctype html>
<html>
<head>
<title>Test Event Handling Performance</title>
<script src="benchmark.js"></script>
<script src="jquery-basis.js"></script>
<script>var old = jQuery.noConflict(true);</script>
<script src="../dist/jquery.js"></script>
<script>
var events = [], num = 400, exec = false;
jQuery(function(){
var p = old("p");
var s = (new Date).getTime();
for ( var n = 0; n < 5; n++ ) {
for ( var i = 0; i < num; i++ ) {
p.css("position");
p.css("top");
p.css("left");
p.css("display");
}
}
var oldNum = (new Date).getTime() - s;
p = jQuery("p");
s = (new Date).getTime();
for ( var n = 0; n < 5; n++ ) {
for ( var i = 0; i < num; i++ ) {
p.css("position");
p.css("top");
p.css("left");
p.css("display");
}
}
var curNum = (new Date).getTime() - s;
jQuery("#num").text( old.fn.jquery + ": " + oldNum + " " + jQuery.fn.jquery + ": " + curNum );
});
</script>
<style>p { position: absolute; top: 5px; left: 5px; }</style>
</head>
<body>
<p id="num">Hello there!</p>
</body>
</html>
Oops, something went wrong.

0 comments on commit 9dd70a4

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