summaryrefslogtreecommitdiff
path: root/swat.obsolete/apps/qooxdoo-examples/test/CanvasLayout_2.html
blob: 19c9a364c1ec6b1f7b4dda97681b089cdb550739 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>qooxdoo &raquo; Demo</title>
  <link type="text/css" rel="stylesheet" href="../../resource/css/layout.css"/>
  <!--[if IE]>
  <link type="text/css" rel="stylesheet" href="../../resource/css/layout_ie.css"/>
  <![endif]-->
  <script type="text/javascript" src="../../script/qx.js"></script>
</head>
<body>
  <script type="text/javascript" src="../../script/layout.js"></script>

  <div id="demoDescription">

  </div>

  <script type="text/javascript">
  qx.core.Init.getInstance().defineMain(function()
  {
    var d = qx.ui.core.ClientDocument.getInstance();
    var w, j;

    for (var i=1; i<=500; i++)
    {
      w = new qx.ui.basic.Terminator;

      // unneeded local 'var' statement here costs 0 in all browsers

      // qx.ui.basic.Terminator vs. qx.ui.core.Parent
      // + 50ms IE
      // + 140ms(!) MOZ




      // Qooxdoo SET vs. Qooxdoo APPLY
      // + 300ms IE
      // + 50ms MOZ
      /*
      w.setWidth(1);
      w.setHeight(1);
      w.setLeft(20+(1*i));
      w.setTop(48+(1*i));
      */

      
      // apply here does not work with new unit handling
      w.setWidth(1);
      w.setHeight(1);

      // apply der Dimensionen kostet:
      // IE: 200ms
      // MOZ: 150ms

      // 1. davon der modifier: 200ms (IE) (also quasi alles)

      // 1a. davon das Speichern des Typs: 180ms
      // 1b. davon das Hineinhängen in die Queues: 20ms

      // 1a1. davon das Ermitteln des Typs: 30ms
      // 1a2. das pure switch kostet 100ms (unglaublich aber wahr)
      // 1a3. das eigentliche speichern liegt bei rund 10ms (incl Math.round - es waren pixel werte)
      // 1a4. das Invalidieren von percent/auto switches braucht 20ms
      // - und der rest von ~20ms hier ist wohl logik overhead



      // apply here does not work with new unit handling
      w.setLeft(20+(1*i));
      w.setTop(48+(1*i));

      // apply der Koordinaten kostet:
      // IE: 200ms
      // MOZ: 50ms





      // Qooxdoo method for background color vs. style property
      // + 400ms IE
      // + 150ms MOZ
      // w.setBackgroundColor(1+(i/2));

      j = Math.round(i/2).toString();
      w.setStyleProperty("backgroundColor", "rgb(" + j + "," + j + "," + j + ")");

      // das style property kostet auch schon 200ms im IE und 150ms(!) im MOZ
      // herrlich




      // das Entfernen der Default-Einträge im qx.ui.core.Widget für
      // die ID und den zusammengesetzten Classname bringen:
      // 30ms IE
      // 0ms MOZ






      d.add(w);

      // Add:
      // IE: +140ms
      // MOZ: +0ms


      // das komplexere add (wie aktuell in qx.ui.core.Parent) kostet bei 500 Objekten 20-30ms
      // mehr (IE) als ein ganz simples setParent, also nicht wirklich nennenswert.



      // das add im qx.ui.core.ClientDocument (welches hier verwendet wird),
      // bringt nochmal 20-30ms im IE



      // das "_modifyParent" kostet 90-100 ms im IE :(

      // 40ms davon für:
      // this._addToQueues();

      // 10ms davon für
      // this._addToParentQueue(propValue);

      // das children managment (push/insertAt)
      // scheint nichts oder sehr wenig zu kosten

      // das in die element queue hängen
      // verhält sich ähnlich
    };
  });
  </script>
</body>
</html>