From b395af5e7aa5301b676472ad3da84a88774a41ec Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Thu, 17 Jan 2013 09:38:49 +0000 Subject: [PATCH] efl: stupid micro optimization. This single test accounted for 1% of my terminology benchmark. I am considering moving evas_string_char_next_get and eina_unicode_utf8_get_next to become inline as their function entry/exit point account for 3% of the same benchmark. The biggest win would be to get rid of the memcpy _termpty_text_copy that account for 16%. In the micro optimization part, we also still do to much malloc in font_draw_prepare as we don't recycle the array there and account for 3% of the benchmark in malloc/free there. In the same ballpark _text_save_top account for 2% of the time in malloc/free. In that same benchmark, evas_object_textgrid_render account for 5% where 4% of its time is spend in evas_common_font_draw_prepare. At this point I am not sure that rewriting textgrid is gona help us at all. We will win almost as much by just inlining the get_next things in evas and eina for a minute of development time. SVN revision: 82927 --- src/lib/evas/canvas/evas_object_text.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 8ad304e..c9909ae 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -1672,8 +1672,11 @@ evas_string_char_next_get(const char *str, int pos, int *decoded) { int p, d; - if (decoded) *decoded = 0; - if ((!str) || (pos < 0)) return 0; + if ((!str) || (pos < 0)) + { + if (decoded) *decoded = 0; + return 0; + } p = pos; d = eina_unicode_utf8_get_next(str, &p); if (decoded) *decoded = d; -- 2.7.4