aboutsummaryrefslogtreecommitdiffstats
path: root/speed/css.html
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2010-09-17 15:38:27 -0400
committerJohn Resig <jeresig@gmail.com>2010-09-17 15:38:27 -0400
commit9dd70a44ad682e7b9aa66680c54a38789a116e27 (patch)
tree8e997e426fb58488aacbcac8c10e2d0222a69da6 /speed/css.html
parent8691a826c0110639480b3eae9e21db05d72bf305 (diff)
downloadjquery-9dd70a44ad682e7b9aa66680c54a38789a116e27.tar.gz
jquery-9dd70a44ad682e7b9aa66680c54a38789a116e27.zip
Adding a simple file for doing .css() performance testing.
Diffstat (limited to 'speed/css.html')
-rw-r--r--speed/css.html49
1 files changed, 49 insertions, 0 deletions
diff --git a/speed/css.html b/speed/css.html
new file mode 100644
index 000000000..e85575684
--- /dev/null
+++ b/speed/css.html
@@ -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>