aboutsummaryrefslogtreecommitdiffstats
path: root/speed
diff options
context:
space:
mode:
authorMichał Z. Gołębiowski <michal.golebiowski@laboratorium.ee>2013-03-12 21:06:25 -0400
committerTimmy Willison <timmywillisn@gmail.com>2013-03-12 21:06:25 -0400
commit79992d752393d80822a4f8be2b7bec3ecdd60f6a (patch)
tree2c97c4bda379e70501b15f106f5efa241c220fe3 /speed
parentae3524642c54ec4df09733de03c169f4fd43ac34 (diff)
downloadjquery-79992d752393d80822a4f8be2b7bec3ecdd60f6a.tar.gz
jquery-79992d752393d80822a4f8be2b7bec3ecdd60f6a.zip
Edited comments and minor adjustments. Fixes #13553. Closes gh-1195.
Diffstat (limited to 'speed')
-rw-r--r--speed/benchmark.js2
-rw-r--r--speed/event.html2
-rw-r--r--speed/slice.vs.concat.html26
3 files changed, 15 insertions, 15 deletions
diff --git a/speed/benchmark.js b/speed/benchmark.js
index b970e14af..334abf15d 100644
--- a/speed/benchmark.js
+++ b/speed/benchmark.js
@@ -4,7 +4,7 @@ function benchmark(fn, times, name){
var s = fn.indexOf('{')+1,
e = fn.lastIndexOf('}');
fn = fn.substring(s,e);
-
+
return benchmarkString(fn, times, name);
}
diff --git a/speed/event.html b/speed/event.html
index 6d463b4d8..eb4dfc7ce 100644
--- a/speed/event.html
+++ b/speed/event.html
@@ -8,7 +8,7 @@
<script src="../dist/jquery.js"></script>
<script>
jQuery(function(){
-
+
});
var events = [], num = 400, exec = false;
diff --git a/speed/slice.vs.concat.html b/speed/slice.vs.concat.html
index 949c5f962..a5372a690 100644
--- a/speed/slice.vs.concat.html
+++ b/speed/slice.vs.concat.html
@@ -6,42 +6,42 @@
var SIZE = 1e4,
LOOPS = 500;
-
+
var arr = new Array(SIZE);
- for ( var i=arr.length-1; i >= 0; --i )
+ for ( var i = arr.length - 1; i >= 0; --i )
arr[i] = 0;
var t = new Date;
- for ( i=0; i < LOOPS; i++ )
+ for ( i = 0; i < LOOPS; i++ )
arr.slice(0);
var tslice = new Date - t;
-
+
t = new Date;
- for ( i=0; i < LOOPS; i++ )
+ for ( i = 0; i < LOOPS; i++ )
arr.concat();
var tconcat = new Date - t;
-
+
// clone() is just to see how fast built-ins are
t = new Date;
- for ( i=0; i < LOOPS; i++ )
+ for ( i = 0; i < LOOPS; i++ )
clone(arr);
var tclone = new Date - t;
-
+
alert([
'slice:'+tslice,
'concat:'+tconcat,
'clone:'+tclone
].join('\n'));
-
-
+
+
function clone(arr){
var i = arr.length,
copy = new Array(i);
-
+
while (i--)
copy[i] = arr[i];
-
+
return copy;
}
})();
-</script> \ No newline at end of file
+</script>