r19141: add a reasonable subset of the qooxdoo runtime environment, and example appli...
[kai/samba.git] / swat / apps / qooxdoo-examples / performance / ObjectCreate_2.html
1 <html>
2 <head>
3   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4   <title>qooxdoo &raquo; Demo</title>
5   <link type="text/css" rel="stylesheet" href="../../resource/css/layout.css"/>
6   <!--[if IE]>
7   <link type="text/css" rel="stylesheet" href="../../resource/css/layout_ie.css"/>
8   <![endif]-->
9   <script type="text/javascript" src="../../script/qx.js"></script>
10 </head>
11 <body>
12   <script type="text/javascript" src="../../script/layout.js"></script>
13
14   <div id="demoDescription">
15     <p>Tests for filled Object creation performance</p>
16     <ol>
17       <li>Using "{ content }"</li>
18       <li>Using "new Object; obj.key = value"</li>
19       <li>Using "new Object(); obj.key = value"</li>
20     </ol>
21   </div>
22
23   <script type="text/javascript">
24   qx.core.Init.getInstance().defineMain(function()
25   {
26     function ObjectCreate1(vLoops)
27     {
28       var foo;
29
30       for (var i=0; i<vLoops; i++) {
31         foo = {
32           key1 : 1,
33           key2 : 2,
34           key3 : 3,
35           key4 : 4,
36           key5 : 5
37         };
38       };
39     };
40
41     function ObjectCreate2(vLoops)
42     {
43       var foo;
44
45       for (var i=0; i<vLoops; i++)
46       {
47         foo = new Object;
48
49         foo.key1 = 1;
50         foo.key2 = 2;
51         foo.key3 = 3;
52         foo.key4 = 4;
53         foo.key5 = 5;
54       };
55     };
56
57     function ObjectCreate3(vLoops)
58     {
59       var foo;
60
61       for (var i=0; i<vLoops; i++)
62       {
63         foo = new Object();
64
65         foo.key1 = 1;
66         foo.key2 = 2;
67         foo.key3 = 3;
68         foo.key4 = 4;
69         foo.key5 = 5;
70       };
71     };
72
73     new qx.dev.TimeTracker(ObjectCreate1, ObjectCreate2, ObjectCreate3);
74   });
75   </script>
76 </body>
77 </html>