Reduce memory consumption for text visual with styles and emoji 02/150802/9
authorRichard Huang <r.huang@samsung.com>
Mon, 18 Sep 2017 15:57:11 +0000 (16:57 +0100)
committerRichard Huang <r.huang@samsung.com>
Thu, 28 Sep 2017 16:25:50 +0000 (17:25 +0100)
commitea959dca7c4e132a51bac0381df1d7b006646099
treef7443ed5391a9cb7f6eb5c31890cbf770887d093
parent18b2fbead069731d9deb5a634cf98c433d172bbe
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