PDA

View Full Version : performance Vs. Dom size



gkatz
5 May 2011, 12:02 AM
Hi;
I have read and watched webcast about the importance of small DOM size and destroying unused components.
from what I have experienced, I dont think this rule applys to many situations. I find that, for example, a destroying a carousel with 10 images in it, on deactivation, will impact user experience such that the animations are not smooth anymore (probably the destroy takes some CPU).

I know that I do not provide to many details about my app but your comments are welcomed

realjax
5 May 2011, 1:00 AM
It should be destroyed after animations are done, which is on the deactivate event of the panel that is being animated. Are you maybe destroying on the wrong deactivate event?

gkatz
5 May 2011, 1:54 AM
Interesting.
my psudo code is as follows:
--panel (card layout)
-----list (of 7 carousels. itemtap slides to the carousel card that was chosen)
-----carousel 1
-----carousel N

each carousel has the following listeners :
activate: build caruosel content (images)
deactivate: remove carousel content

is this what you meant?

BTW the behavior I see is kinda strange:
the animation smooth transition halters only at the end of the animation (its like the card slides almost until the end but gets stuck at the last milimeter)
tested only on samsung galaxy S.

realjax
5 May 2011, 2:18 AM
Sounds ok to me. And all you do on the deactivate event is a this.destroy() ?

gkatz
5 May 2011, 2:20 AM
correct;
I will check on my iphone later to see if the behavior is the same as in the galaxy s