[4.0] Reduce memory consumption for text visual with styles and emoji 57/153757/1
authorRichard Huang <r.huang@samsung.com>
Mon, 18 Sep 2017 15:57:11 +0000 (16:57 +0100)
committerJinho, Lee <jeano.lee@samsung.com>
Fri, 29 Sep 2017 09:50:03 +0000 (18:50 +0900)
commiteb2efac5448ec66c66668701823444ee73c606b6
tree72f29c2933d78ddbf817d31f6b6eb82653f5b7c4
parent0b5699811bac5ff1b3c92a2245d4ec594cade5e6
[4.0] Reduce memory consumption for text visual with styles and emoji

Measured using memps on target by creating 500 TextLabels, and memory
is reduced by 60% in the best case and by 25% in the worst case.

For example:

TextLabel with single color text and styles:

Before applying this patch:

S(CODE)  S(DATA)  P(CODE)  P(DATA)     PEAK      PSS       3D
  12996      236       20   275620   289148   278088   270824

After applying this patch:

S(CODE)  S(DATA)  P(CODE)  P(DATA)     PEAK      PSS       3D
  13204      236       16   126852   140308   129395   114728

TextLabel with multiple text colors (by enabling markup):

Before applying this patch:

S(CODE)  S(DATA)  P(CODE)  P(DATA)     PEAK      PSS       3D
  13204      236       20   275512   289064   278840   270824

After applying this patch:

S(CODE)  S(DATA)  P(CODE)  P(DATA)     PEAK      PSS       3D
  13204      236       16    99388   112844   102713    90696

Change-Id: I533122b647678dc9888a1f4b94efd59336e2bfdb
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
dali-toolkit/internal/text/rendering/text-typesetter.cpp
dali-toolkit/internal/visuals/text/text-visual.cpp
dali-toolkit/internal/visuals/text/text-visual.h
dali-toolkit/internal/visuals/visual-factory-cache.h