What's this delayed execution stuff about originally? It's actually a trick to get around browser inefficiencies in rendering DOM nodes with CSS attributes.
Consider the following two code snippets:
// placing 5000 "Hello World" messages in random positions
for(var i=0;i<5000;i++)
{
var node = document.createElement("div");
node.appendChild(document.createTextNode("Hello World!"));
document.body.appendChild(node);
node.style.position = "absolute";
node.style.left = parseInt(Math.random() * 800) + "px";
node.style.top = parseInt(Math.random() * 800) + "px";
}
// placing 5000 "Hello World" messages in random positions
for(var i=0;i<5000;i++)
{
var node = document.createElement("div");
node.appendChild(document.createTextNode("Hello World!"));
node.style.position = "absolute";
node.style.left = parseInt(Math.random() * 800) + "px";
node.style.top = parseInt(Math.random() * 800) + "px";
document.body.appendChild(node);
}
Both code snippets place 5000 randomly positioned "Hello World!" messages in the browser window. The two code snippets differ only in the placement of the document.body.appendChild() line. Running the first code snippet in Firefox can take 1 minute or more, but running the second one takes only a few seconds. The second code snippet provides a more than 10x speedup compared to the first code snippet.
Similar phenomenon can be observed in Internet Explorer also, but only with much more complicated logic, so we'll not go over that. But anyway, the moral of the story is, modifying some CSS attributes (especially positioning attributes) is harmful after the DOM node is already visible.
So what did the scrapped delayed execution idea has to do with these browser weirdnesses? The delayed execution idea was meant to help in batch widget creation and batch CSS style manipulations. e.g. when you're creating 100 widgets in a single pass. It speeds up widget creation or CSS style manipulation by making a common ancestor DOM node of the widgets being manipulated/created invisible before executing the performance sensitive code, and making the ancestor node visible again after execution.
Sounds like a hack - yes it is a hack. It sometimes breaks your application code, it requires you to change your application code to use it. But as shown in the videos, it worked.
Now, the hack is scrapped, before it is even released. And that's because we've got a more consistent way of implementing the same optimization in WT Toolkit, without the need of using hacks.
So what do we have for 0.3.3 now:
- Massively increased widget creation performance in Internet Explorer, without needing the developer to change a single line of code.
- No performance improvement in Firefox if you don't change your application code... Oops?! But hey, that would be the same if we implemented the delayed execution hack.
Say, if you have
var n = new wtButton(myParent, "Yes!");
n.setAbsolutePosition(x, y);
Then, the optimized version would be
var n = new wtButton(null, "Yes!");
n.setAbsolutePosition(x, y);
myParent.addWidget(n);
Actually, you can perform the manual optimization with WT Toolkit 0.3.2 too.
61 comments:
Кстати, не зря блогоньюс называется местом сбора всего самого увлекательного. [URL=http://blogonews.net]Интересный сайт[/URL] - несомненно правильное название сайта.
xanax without prescription legal to order xanax online - percocet xanax high
tramadol 50 mg what does tramadol 50 mg look like - buy tramadol online florida
buy tramadol online buy tramadol overnight delivery no prescription - buy tramadol online overnight shipping
order xanax xanax clearance drug screen - xanax side effects shaking
xanax online prescription there 4mg xanax bars - xanax pills g3719
buy tramadol online rx tramadol sr - 100 mg - tramadol 50 mg snorting
where can i buy xanax online legally xanax 2mg oval - xanax 031 side effects
generic xanax generic xanax good xanax - order my xanax prescription online
tramadol 50mg buy tramadol in europe - ultram tramadol forum
buy tramadol online tramadol ultram er - tramadol euphoria dose
buy carisoprodol buy soma carisoprodol online - carisoprodol soma watson brand
buy tramadol online tramadol dosage sizes - buy tramadol online overnight
xanax online pictures of generic xanax bars - buy xanax san francisco
buy tramadol online tramadol purchase online no prescription - tramadol yellow and green capsule
xanax mg buy generic xanax no prescription - buy xanax 2mg bars online
buy carisoprodol carisoprodol hair drug test - carisoprodol 350 mg for pain
xanax online xanax 4mg pill - xanax and alcohol lethal
carisoprodol online carisoprodol overdose emedicine - drug drug interactions carisoprodol
buy tramadol with mastercard order tramadol visa - tramadol addiction after 1 week
xanax online results xanax overdose - zolpidem xanax overdose
buy carisoprodol carisoprodol 350 mg interactions - carisoprodol 350 mg pill
carisoprodol 350 mg carisoprodol pharmacokinetics - carisoprodol 350 mg muscle relaxer
buy tramadol online no prescription tramadol 50mg tablets ingredients - tramadol for dogs mg
buy cialis online usa buy generic viagra cialis online - buy cialis online us
tramadol 50 mg cheap tramadol online cod - tramadol and us overnight no prescription
cialis online best way buy cialis online - cialis price daily use
buy cialis online generic cialis best price - cialis daily wholesale
buy cialis online cialis kopen - cialis generic no prescription
buy cialis online order viagra cialis online - buy cialis drugstore
buy cialis prescription online cialis daily tadalafil - cialis 20 reviews
cialis online buying cialis online forum - cialis online in usa
xanax online generic xanax pill identifier 029 - xanax xr 1mg price
cialis online cialis price pharmacy - cialis coupon
learn how to buy tramdadol can you buy tramadol online no prescription - tramadol 319 high
learn how to buy tramdadol buy tramadol australia - tramadol online no prescription overnight cod
buy discount tramadol how to order tramadol - tramadol hcl xr
learn how to buy tramdadol tramadol ultram seizures - tramadol 50mg for pets
buy tramadol tramadol dosage dogs - buy tramadol online saturday delivery
buy tramadol online no prescription tramadol online mastercard - tramadol 50 mg tab amne
buy tramadol buy tramadol online with credit card - tramadol online american express
buy tramadol cod tramadol in pregnancy - where to buy tramadol forum
buy tramadol tramadol buy florida - tramadol ingredients side effects
tramadol 100mg buy tramadol online eu - best online pharmacy tramadol
buy tramadol online cheap buy tramadol online prescription - buy tramadol 99
buy tramadol buy tramadol overnight no prescription - buy-tramadol-online.org
buy tramadol tramadol for dogs effects - tramadol 50mg 627
buy ativan online ativan getting high - 8 ativan
http://blog.dawn.com/dblog/buy/#56932 order tramadol cod next day delivery - tramadol withdrawal wellbutrin
ways to buy ativan online ativan withdrawal caffeine - ativan high blood pressure
buy tramadol cheap 100mg tramadol - tramadol hydrochloride capsules 100 mg
ativan pharmacy ativan withdrawal emedicine - ativan overdose level
http://staam.org/#36750 tramadol online pharmacy no prescription needed - tramadol itching
buy tramadol online tramadol hydrochloride 50mg dosage - buy ultram tramadol online
buy xanax online buy xanax online cod - generic xanax pill description
buy tramadol online tramadol dosage get high - buy tramadol online prescription
buy xanax online xanax and alcohol teenagers - xanax you buy online real
alprazolam xanax 2mg too much - xanax and alcohol withdrawal symptoms
buy xanax online xanax overdose kill - buy generic xanax no prescription
buy xanax online cost of generic xanax at walmart - 2mg xanax and 2 beers
buy xanax online cod side effects from xanax drug - xanax xr 3mg
Post a Comment