App lags, website doesn't
I'm building a small app with Adobe AIR using HTML and JavaScript. When I view the app as a regular website (no matter in which browser), it's all perfe开发者_高级运维ctly fine. But when I view it as an AIR app (with the adl command or in a proper package), all the effects, mostly jQuery, make the website lag.
I do not use any fancy effects, it's just about image sliders. Any ideas where this is coming from?
Thanks!
PS: I know it's not because my PC is too slow; I recently bought new hardware for 700 EUR (~980 $; ~620 GBP) :)
I had the same problem.
It turned out, you MUST NOT use box-shadow
-webkit-box-shadow
or text-shadow
css properties in your air app. It works fine in other browsers? but dramatically slowes down air performance.
That worked for me.
I'm working on a JavaScript AIR app at the moment that is running jQuery without a problem on very low spec PC, and is actually impressing me with how fast it is (knock on wood!). Adobe improved JavaScript performance recently, so if you haven't got the latest runtime (currently 2.7) then definitely grab that.
As for the jQuery itself, make sure you are using the minified versions of the jQuery libraries, and only include the ones that you absolutely need. It's always a good idea to compress images as much as you can, as moving big images around will obviously take more processing power.
You could also take a look at this article about performance tuning AIR apps, although it is focussed on Flex and AS development.
http://www.adobe.com/devnet/air/articles/air_performance.html
Good luck!
精彩评论