View Full Version : performance Vs. Dom size

5 May 2011, 12:02 AM
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

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?

5 May 2011, 1:54 AM
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.

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

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