J
john_woo
Hi,
supposed given:
var o = aDiv.childNodes, and there are about 1000 img objects + other
types of objects in o; the img object has id, position, size.
what to do:
Each of those img object has to be modified once, the order to modify
depends on run time value of given position.
require high performance.
I'm wondering:
without using 3rd lib (except built-in, ex. prototype.js), how to
manipulate such data with respect of higher performance.
ex.
1. I can define a class which represents img, then using array to
store these 1000 img instances, then every time look into this array.
in this case, how to remove an element so that next time the length of
array decreased?
2. just using array to store all img objects.
3. simply just using o and looks for tag name of img, and every time
looks into this o.
in this case, again how to remove an element so that next time no
necessary look up same amount of elements, and does this have side-
effect?
....
supposed given:
var o = aDiv.childNodes, and there are about 1000 img objects + other
types of objects in o; the img object has id, position, size.
what to do:
Each of those img object has to be modified once, the order to modify
depends on run time value of given position.
require high performance.
I'm wondering:
without using 3rd lib (except built-in, ex. prototype.js), how to
manipulate such data with respect of higher performance.
ex.
1. I can define a class which represents img, then using array to
store these 1000 img instances, then every time look into this array.
in this case, how to remove an element so that next time the length of
array decreased?
2. just using array to store all img objects.
3. simply just using o and looks for tag name of img, and every time
looks into this o.
in this case, again how to remove an element so that next time no
necessary look up same amount of elements, and does this have side-
effect?
....