| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| 2 |
"http://www.w3.org/TR/html4/strict.dtd"> |
| 3 |
|
| 4 |
<html> |
| 5 |
<head> |
| 6 |
<title>test of various synchronous page searching methods</title> |
| 7 |
<style type="text/css"> |
| 8 |
@import "../themes/claro/document.css"; |
| 9 |
@import "../themes/tundra/tundra.css"; |
| 10 |
</style> |
| 11 |
<script type="text/javascript" src="../../dojo/dojo.js" |
| 12 |
data-dojo-config="parseOnLoad: true, isDebug: true"></script> |
| 13 |
<script type="text/javascript"> |
| 14 |
dojo.require("dojo.parser"); // scan page for widgets and instantiate them |
| 15 |
dojo.require("dijit._WidgetBase"); |
| 16 |
dojo.require("dijit._TemplatedMixin"); |
| 17 |
|
| 18 |
/* dummy widget for benchmarking purposes */ |
| 19 |
dojo.declare( |
| 20 |
"SimpleButton", |
| 21 |
[ dijit._WidgetBase, dijit._TemplatedMixin ], |
| 22 |
{ |
| 23 |
label: "", |
| 24 |
|
| 25 |
templateString: "<button data-dojo-attach-event='onclick:onClick'>${label}</button>", |
| 26 |
|
| 27 |
onClick: function(){ |
| 28 |
this.domNode.style.backgroundColor="green"; |
| 29 |
}, |
| 30 |
postCreate: function(){ |
| 31 |
} |
| 32 |
} |
| 33 |
); |
| 34 |
</script> |
| 35 |
</head> |
| 36 |
<body> |
| 37 |
<h1 style="font-size: 40px; line-height: 50px;">This page contains a huge number of nodes, most of which are "chaff".</h1> |
| 38 |
<h3>Here's the relative timings for this page</h3> |
| 39 |
<div id="profileOutputTable"></div> |
| 40 |
<!-- |
| 41 |
<h3>And some comparison data</h3> |
| 42 |
<table border=1> |
| 43 |
<thead> |
| 44 |
<tr> |
| 45 |
<th>IE |
| 46 |
<th>Safari |
| 47 |
<th>Gecko (on PC) |
| 48 |
<th>Gecko (on intel mac) |
| 49 |
</tr> |
| 50 |
</thead> |
| 51 |
<tbody> |
| 52 |
<tr> |
| 53 |
<td>4890 |
| 54 |
<td>3242 |
| 55 |
<td>3094 |
| 56 |
<td>3782 |
| 57 |
</tr> |
| 58 |
</tbody> |
| 59 |
</table> |
| 60 |
--> |
| 61 |
|
| 62 |
|
| 63 |
<? |
| 64 |
$containerDepth = 30; |
| 65 |
$leadingChaff = 100; |
| 66 |
$trailingChaff = 100; |
| 67 |
$items = 100; |
| 68 |
?> |
| 69 |
<? |
| 70 |
function generateChaff($iters){ |
| 71 |
for($i=0;$i<$iters;$i++){ ?> |
| 72 |
<pre class="highlighted"><code><span class="hl-reserved">var </span><span class="hl-identifier">dlg</span><span class="hl-default"> = </span><span class="hl-reserved">new </span><span class="hl-identifier">blah</span><span class="hl-default">.</span><span class="hl-identifier">ext</span><span class="hl-default">.</span><span class="hl-identifier">LayoutDialog</span><span class="hl-brackets">(</span><span class="hl-identifier">config</span><span class="hl-code">.</span><span class="hl-identifier">id</span><span class="hl-code"> || </span><span class="hl-identifier">blah</span><span class="hl-code">.</span><span class="hl-identifier">util</span><span class="hl-code">.</span><span class="hl-identifier">Dom</span><span class="hl-code">.</span><span class="hl-identifier">generateId</span><span class="hl-brackets">()</span><span class="hl-code">, </span><span class="hl-brackets">{ |
| 73 |
</span><span title="autoCreate" class="hl-identifier">autoCreate</span><span class="hl-code"> : </span><span class="hl-reserved">true</span><span class="hl-code">, |
| 74 |
</span><span title="minWidth" class="hl-identifier">minWidth</span><span class="hl-code">:</span><span class="hl-number">400</span><span class="hl-code">, |
| 75 |
</span><span title="minHeight" class="hl-identifier">minHeight</span><span class="hl-code">:</span><span class="hl-number">300</span><span class="hl-code">, |
| 76 |
</span> |
| 77 |
<span title="syncHeightBeforeShow" class="hl-identifier">syncHeightBeforeShow</span><span class="hl-code">: </span><span class="hl-reserved">true</span><span class="hl-code">, |
| 78 |
</span><span title="shadow" class="hl-identifier">shadow</span><span class="hl-code">:</span><span class="hl-reserved">true</span><span class="hl-code">, |
| 79 |
</span><span title="fixedcenter" class="hl-identifier">fixedcenter</span><span class="hl-code">: </span><span class="hl-reserved">true</span><span class="hl-code">, |
| 80 |
</span><span title="center" class="hl-identifier">center</span><span class="hl-code">:</span><span class="hl-brackets">{</span><span class="hl-identifier">autoScroll</span><span class="hl-code">:</span><span class="hl-reserved">false</span><span class="hl-brackets">}</span><span class="hl-code">, |
| 81 |
</span><span title="east" class="hl-identifier">east</span><span class="hl-code">:</span><span class="hl-brackets">{</span><span class="hl-identifier">split</span><span class="hl-code">:</span><span class="hl-reserved">true</span><span class="hl-code">,</span><span class="hl-identifier">initialSize</span><span class="hl-code">:</span><span class="hl-number">150</span><span class="hl-code">,</span><span class="hl-identifier">minSize</span><span class="hl-code">:</span><span class="hl-number">150</span><span class="hl-code">,</span><span class="hl-identifier">maxSize</span><span class="hl-code">:</span><span class="hl-number">250</span><span class="hl-brackets">} |
| 82 |
})</span><span class="hl-default">; |
| 83 |
</span><span class="hl-identifier">dlg</span><span class="hl-default">.</span><span class="hl-identifier">setTitle</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">Choose an Image</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-default">; |
| 84 |
</span><span class="hl-identifier">dlg</span><span class="hl-default">.</span><span class="hl-identifier">getEl</span><span class="hl-brackets">()</span><span class="hl-default">.</span><span class="hl-identifier">addClass</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">ychooser-dlg</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-default">;</span></code></pre><br /> |
| 85 |
<pre class="highlighted"><code><span class="hl-reserved">var </span><span class="hl-identifier">animated</span><span class="hl-default"> = </span><span class="hl-reserved">new </span><span class="hl-identifier">blah</span><span class="hl-default">.</span><span class="hl-identifier">ext</span><span class="hl-default">.</span><span class="hl-identifier">Resizable</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">animated</span><span class="hl-quotes">'</span><span class="hl-code">, </span><span class="hl-brackets">{ |
| 86 |
</span><span title="east" class="hl-identifier">width</span><span class="hl-code">: </span><span class="hl-number">200</span><span class="hl-code">, |
| 87 |
</span><span title="east" class="hl-identifier">height</span><span class="hl-code">: </span><span class="hl-number">100</span><span class="hl-code">, |
| 88 |
</span><span title="east" class="hl-identifier">minWidth</span><span class="hl-code">:</span><span class="hl-number">100</span><span class="hl-code">, |
| 89 |
</span><span class="hl-identifier">minHeight</span><span class="hl-code">:</span><span class="hl-number">50</span><span class="hl-code">, |
| 90 |
</span><span class="hl-identifier">animate</span><span class="hl-code">:</span><span class="hl-reserved">true</span><span class="hl-code">, |
| 91 |
</span><span class="hl-identifier">easing</span><span class="hl-code">: </span><span class="hl-identifier">YAHOO</span><span class="hl-code">.</span><span class="hl-identifier">util</span><span class="hl-code">.</span><span class="hl-identifier">Easing</span><span class="hl-code">.</span><span class="hl-identifier">backIn</span><span class="hl-code">, |
| 92 |
</span><span class="hl-identifier">duration</span><span class="hl-code">:</span><span class="hl-number">.6 |
| 93 |
</span><span class="hl-brackets">})</span><span class="hl-default">;</span></code></pre> |
| 94 |
<h4>The standard Lorem Ipsum passage, used since the 1500s</h4> |
| 95 |
<p> |
| 96 |
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do |
| 97 |
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim |
| 98 |
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut |
| 99 |
aliquip ex ea commodo consequat. Duis aute irure dolor in |
| 100 |
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla |
| 101 |
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in |
| 102 |
culpa qui officia deserunt mollit anim id est laborum." |
| 103 |
</p> |
| 104 |
|
| 105 |
<h4>Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC</h4> |
| 106 |
|
| 107 |
<p> |
| 108 |
"Sed ut perspiciatis unde omnis iste natus error sit voluptatem |
| 109 |
accusantium doloremque laudantium, totam rem aperiam, eaque ipsa |
| 110 |
quae ab illo inventore veritatis et quasi architecto beatae vitae |
| 111 |
dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit |
| 112 |
aspernatur aut odit aut fugit, sed quia consequuntur magni dolores |
| 113 |
eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam |
| 114 |
est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci |
| 115 |
velit, sed quia non numquam eius modi tempora incidunt ut labore et |
| 116 |
dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, |
| 117 |
quis nostrum exercitationem ullam corporis suscipit laboriosam, |
| 118 |
nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure |
| 119 |
reprehenderit qui in ea voluptate velit esse quam nihil molestiae |
| 120 |
consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla |
| 121 |
pariatur?" |
| 122 |
</p> |
| 123 |
|
| 124 |
<h4>1914 translation by H. Rackham</h4> |
| 125 |
|
| 126 |
<p> |
| 127 |
"But I must explain to you how all this mistaken idea of denouncing |
| 128 |
pleasure and praising pain was born and I will give you a complete |
| 129 |
account of the system, and expound the actual teachings of the |
| 130 |
great explorer of the truth, the master-builder of human happiness. |
| 131 |
No one rejects, dislikes, or avoids pleasure itself, because it is |
| 132 |
pleasure, but because those who do not know how to pursue pleasure |
| 133 |
rationally encounter consequences that are extremely painful. Nor |
| 134 |
again is there anyone who loves or pursues or desires to obtain |
| 135 |
pain of itself, because it is pain, but because occasionally |
| 136 |
circumstances occur in which toil and pain can procure him some |
| 137 |
great pleasure. To take a trivial example, which of us ever |
| 138 |
undertakes laborious physical exercise, except to obtain some |
| 139 |
advantage from it? But who has any right to find fault with a man |
| 140 |
who chooses to enjoy a pleasure that has no annoying consequences, |
| 141 |
or one who avoids a pain that produces no resultant pleasure?" |
| 142 |
</p> |
| 143 |
<? } |
| 144 |
} |
| 145 |
$widgetName = "SimpleButton"; |
| 146 |
?> |
| 147 |
<? generateChaff($leadingChaff); ?> |
| 148 |
<hr> |
| 149 |
<? for($i=0;$i<$containerDepth;$i++){ ?> |
| 150 |
<table border="1" cellpadding="0" cellspacing="0" width="100%"> |
| 151 |
<!-- |
| 152 |
<table> |
| 153 |
--> |
| 154 |
<tr> |
| 155 |
<td> |
| 156 |
<br> |
| 157 |
chaff! |
| 158 |
<br> |
| 159 |
<? } ?> |
| 160 |
<? for($i=0;$i<$items;$i++){ ?> |
| 161 |
<div data-dojo-type="<?= $widgetName ?>" label="item2 <?= $i ?>">item2 <?= $i ?></div> |
| 162 |
<? } ?> |
| 163 |
<? for($i=0;$i<$containerDepth;$i++){ ?> |
| 164 |
</td> |
| 165 |
</tr> |
| 166 |
</table> |
| 167 |
<? } ?> |
| 168 |
<? generateChaff($trailingChaff); ?> |
| 169 |
<? for($i=0;$i<$items;$i++){ ?> |
| 170 |
<div data-dojo-type="<?= $widgetName ?>" label="item2 <?= $i ?>"><span>item <?= $i ?></span></div> |
| 171 |
<? } ?> |
| 172 |
|
| 173 |
<script type="text/javascript"> |
| 174 |
|
| 175 |
oldTime = new Date(); |
| 176 |
dojo.ready(function(){ |
| 177 |
var time = new Date().getTime() - oldTime; |
| 178 |
var p = document.createElement("p"); |
| 179 |
alert("Widgets loaded in " + time + "ms"); |
| 180 |
}); |
| 181 |
|
| 182 |
</script> |
| 183 |
|
| 184 |
</body> |
| 185 |
</html> |