Bug 449371 Firefox/Thunderbird crashes at exit [@ gdk_display_x11_finalize], p=Brian...
[wine-gecko.git] / testing / performance / talos / page_load_test / jss / object-array-6.html
blob3ac5c5d6f0e2e99c91e5f8c675073b932e16687a
1 <html><head>
2 <!-- MOZ_INSERT_CONTENT_HOOK -->
3 <script src = runner.js></script>
4 <script>
5 var onlyName = 'Array Deconstruction, shift', onlyNum = 128;
6 function thisTest() {
8 startTest("object-array");
10 var ret = [], tmp, num = 500;
12 for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
14 // TESTS: Array Building
16 test("Array Construction, []", i, function(){
17 for ( var j = 0; j < num; j++ ) {
18 ret = [];
19 ret.length = i;
21 });
23 test("Array Construction, new Array()", i, function(){
24 for ( var j = 0; j < num; j++ )
25 ret = new Array(i);
26 });
28 test("Array Construction, push", i, function(){
29 ret = [];
30 for ( var j = 0; j < i; j++ )
31 ret.push(j);
32 });
34 i /= 128;
36 test("Array Deconstruction, pop", i, function(){
37 for ( var j = 0; j < i; j++ )
38 tmp = ret.pop();
39 });
41 test("Array Construction, unshift", i, function(){
42 ret = [];
43 for ( var j = 0; j < i; j++ )
44 ret.unshift(j);
45 });
47 test("Array Deconstruction, shift", i, function(){
48 for ( var j = 0; j < i; j++ )
49 tmp = ret.shift();
50 });
52 test("Array Construction, splice", i, function(){
53 ret = [];
54 for ( var j = 0; j < i; j++ )
55 ret.splice(0,0,j);
56 });
58 test("Array Deconstruction, splice", i, function(){
59 for ( var j = 0; j < i; j++ )
60 tmp = ret.splice(0,1);
61 });
63 })(i);
65 endTest();
67 </script>
68 <body onload="thisTest()"></body></html>