common sub-expression elimination
the following code contains common sub-expression:
for (var i=0; i<scrItems.length; i++){
dsetItems[i].name = srcItems[i].name;
dsetItems[i].value = srcItems[i].value;
dsetItems[i].id = srcItems[i].id;
dsetItems[i].data = srcItems[i].data;
}
the code runs faster if factor out the CSE’s:
for (var i=0; i<scrItems.length; i++){
var destItem = destItems[i];
var srcItem = srcItems[i];
dsetItem.name = srcItems.name;
dsetItem.value = srcItems.value;
dsetItem.id = srcItems.id;
dsetItem.data = srcItems.data;
}
many compliers can factor out CSE’s automatically.
ActionScript can’t do this yet, so factoring CSE’s yourserlf will provide performance benefits.
Expect to see many complier optimizations in the future.
factoring out – 반복되는 구문요소를 제거합니다.
About this entry
You’re currently reading “common sub-expression elimination,” an entry on multiplicité
- Published:
- Wednesday, March 17th, 2004 at 10:33 pm
- This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.0 Korea.
- Author:
- vizualizer
- Category:
- techne
Similar Posts
- regular expression in perl
- 경험 경제 experience economy
- 연관배열의 선언(making associative array of generic object)
- Flash MX Programmer’s Guide to ActionScript 2.0
- Materials vs Content in Digitally Mediated Performace
- What is TrackBack?
- Text format tag
- information related research, new and fresh
- MovieClip tweening prototypes 1.1.8
- The most hated Advertising Techniques by Jakob Neilson
No comments
Jump to comment form | comments rss