textblock/optimization: refactor evas_textblock_style for memory and perfromance.
authorsubhransu mohanty <sub.mohanty@samsung.com>
Mon, 12 Aug 2019 02:42:27 +0000 (02:42 +0000)
committerWonki Kim <wonki_.kim@samsung.com>
Wed, 21 Aug 2019 00:25:39 +0000 (09:25 +0900)
commita8e00ea54d7c3cc94b33718b38780e211466ec3b
tree5011adce5ca180b124538f925140f8e9d594d6a5
parentc4e04f45e4f5f426e5be4ed431371610a8911268
textblock/optimization: refactor evas_textblock_style for memory and perfromance.

the main user of textblock_style_set() api is the edje whcih keeps its owen edje_textblock_style
tags( string_shared string) by changing the textblock to keep the string_shared string will improve
the chance of sharing the same string hence reducing memory.

By removing the Eina_StrBuf usage inside the loop in textblock_style_set() api we can avoid lot
of temporary memory allocation and deallocation hence will improve performance.

Note: I see lot of places we use Eina_Strbuf inside a loop (eina_strbuf_new() does 2 allocation)
We need to be extra carefull while reviewing when the code uses those construct to see if its really necessary.

Data: it reduces memory allocation by 7000 in elementary_test launch time.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9545
src/lib/evas/canvas/evas_object_textblock.c