Merge "(ItemView) Store initial value in constraints to apply weight correctly" into...
[platform/core/uifw/dali-toolkit.git] / docs / content / shared-javascript-and-cpp-documentation / performance-tips.md
1 /**
2  *
3
4 # Performance Tips  {#performancetips}
5
6 ## High CPU occupancy
7
8   - Try to reduce actor count ( less actors == less processing)
9   - Delete any actors that are not visible, or move them off stage
10   - Use TextureAtlases ( reduces OpenGL driver calls to glBindTexture
11   - Optimise / reduce any constraints used
12
13 ## High GPU occupancy
14
15   - Reduce visible actor count ( == less draw calls)
16   - For 2D UI graphics which require no z sorting you can use
17 ~~~{.cpp}
18   // In this mode depth testing is turned off and order is determined by the hierachy (depth-first search order).
19   // Not always recommended if there is going to be a lot of overdraw ( if lots of actors are on top of each other)
20
21   Actor::SetDrawMode( DrawMode::OVERLAY ); // C++
22 ~~~~
23 ~~~{.js}
24   actor.drawMode = dali.DRAW_MODE_OVERLAY; // JavaScript
25 ~~~
26   - Use TextureAtlases ( reduces state changes in the GPU)
27   - Use compressed textures
28   - Use lower quality textures, e.g. smaller, lower number of bits per pixel
29   - Use Dali::NinePatchImage  where possible.
30   - Avoid using too many textures which contain alpha and require blending
31   - Avoid using too many Dali::Layer with depth testing enabled. Otherwise the layer has to clear the depth buffer.
32   - Optimise any shaders used. Pixel shaders should be kept as lean as possible.
33
34
35 @class _Guide_Performance_Tips
36 */
37
38