Topic awaiting preservation: Animation vs. efficiency trade-offs/tricks (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: schillmania.com |
posted 05-11-2005 04:21
Alright, time for the question I'm sure there's been a lot of previous discussion/debate on before (which heck, I'm sure I probably participated in at some point):
I've messed around with animation experiments a fair bit in various older projects (eg. "flash-like" portfolio, or dhtml arkanoid etc.) and I think I've been fairly successful in terms of maintaining a good frame rate across various browsers/platforms, but I realised it was probably because in these cases (Arkanoid sometimes not) I wasn't moving a lot of images simultaneously.
I tried a few different techniques along the way (PNGs, playing with image size during animation, using a background tile, filters and .style.opacity for fading etc.), and I haven't compared side-to-side yet but feel the cropped div/img technique seems to work well. Am I going the wrong way here? |
Paranoid (IV) Inmate From: USA |
posted 05-11-2005 07:25
Opera is wicked fast. Safari is catching up... in 2.0, it's better than MSIE now, unless I'm mistaken. FF is still the chugging workhorse, but since it's compatibility is sooo much better than MSIE, you better believe I'm not complaining.
|
Paranoid (IV) Inmate From: France |
posted 05-11-2005 23:30
you already covered a lot of points. However :
Obviously the less work in the inner loops, the faster the result. |
Paranoid (IV) Inmate From: schillmania.com |
posted 05-12-2005 08:35
Iron Wallaby: Thanks for the kind words. |
Paranoid (IV) Inmate From: France |
posted 05-12-2005 10:43
Regarding the canvas animation. Sure it's less elegant ( semantically wise ) to have a DIV and an IMG, but that way you avoid the dumb-cache problem and you can also zoom the IMG ( or should I say the DIV ) which is impossible using the background property, and annoying using the clip property. |
Paranoid (IV) Inmate From: schillmania.com |
posted 05-12-2005 18:51
Poi: |
Paranoid (IV) Inmate From: France |
posted 05-12-2005 19:08
From what I've seen/done the number of elements has a tiny impact on speed compared to the number of elements updated. |