r20445: add README file indicating that the swat directory is no longer relevant
[samba.git] / swat.obsolete / apps / qooxdoo-examples / performance / ObjectSize_1.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>Testing the incluence to the performance of data using the prototype mechanism on classes.</p>
16   </div>
17
18   <script type="text/javascript">
19   qx.core.Init.getInstance().defineMain(function()
20   {
21     var emptyObject = function() {};
22     var protoObject1 = function() {};
23     var protoObject2 = function() {};
24
25     for (var i=0; i<1000; i++)
26     {
27       protoObject1.prototype["i" + i] = function() {
28         alert("Hello World: " + i);
29       };
30     }
31
32     for (var i=0; i<1000; i++)
33     {
34       protoObject2.prototype["i" + i] = "Hello World";
35     }
36
37     function empty(vLoops)
38     {
39       for (var i=0; i<vLoops; i++) {
40         new emptyObject;
41       }
42     }
43
44     function protos1(vLoops)
45     {
46       for (var i=0; i<vLoops; i++) {
47         new protoObject1;
48       }
49     }
50
51     function protos2(vLoops)
52     {
53       for (var i=0; i<vLoops; i++) {
54         new protoObject2;
55       }
56     }
57
58     new qx.dev.TimeTracker(empty, protos1, protos2);
59   });
60   </script>
61 </body>
62 </html>