awayfl / playerglobal

Apache License 2.0
7 stars 2 forks source link

How can I get the best performance? #8

Open lovoror opened 4 years ago

lovoror commented 4 years ago

Is there a best guide?

eXponenta commented 4 years ago
  1. Not use huge lib, like Nape/Box2D or use external JS version for it.
  2. Not use a lot of getPixels/getPixel32/ getData, and all pixel operations on BitmapData that set/return buffers or pixels. Include floodFill, getColorBoundingRect, because it require stop render and grab pixels from GPU
  3. Not use a long property chain's in scrips, because it degraded compiler.
  4. Use blendmodes from list: normal, add, multiple ... Other not supported now.
  5. Not use a lot of separated sprites, 100 unique sprites is drop perf. Use ImageBitmap.draw to manual caching because cacheAsBitmap not supported now. ... ...
lovoror commented 4 years ago

How to show the drawcall on the screen?

lovoror commented 4 years ago

If I have converted vector graphics to bitmaps in swf file , could the performance be improved?