From 9357c5d28449e044dc41e38b326554addf1e49a1 Mon Sep 17 00:00:00 2001 From: Brett Nash Date: Mon, 26 Jul 2010 03:17:40 +0000 Subject: [PATCH] Use memcmp instead of stringshare. Much faster. Everyones favourite arm benchmarks (a8 cortex) Base stringshare memcmp Diff Diff % Widgets File Icons 32.48 36.78 4.3 13.24% Widgets File Icons 2 73.65 74.93 1.28 1.74% Widgets File Icons 3 44.87 46.89 2.02 4.50% Widgets File Icons 4 65.66 66.45 0.79 1.20% Text Basic 88.67 91.21 2.54 2.86% Text Styles 10.71 10.95 0.24 2.24% Text Styles Different St 8.3 8.45 0.15 1.81% Text Change 56.4 57.34 0.94 1.67% Textblock Basic 60.75 68.8 8.05 13.25% Textblock Intl 155.33 193.51 38.18 24.58% SVN revision: 50498 --- legacy/evas/src/lib/engines/common/evas_font_draw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/legacy/evas/src/lib/engines/common/evas_font_draw.c b/legacy/evas/src/lib/engines/common/evas_font_draw.c index 8e9c3ea6b8..e177cac285 100644 --- a/legacy/evas/src/lib/engines/common/evas_font_draw.c +++ b/legacy/evas/src/lib/engines/common/evas_font_draw.c @@ -795,14 +795,12 @@ evas_font_word_prerender(RGBA_Draw_Context *dc, const char *in_text, int len, RG struct prword *w; int gl; - const char *in_ss = eina_stringshare_add(in_text); LKL(lock_words); EINA_INLIST_FOREACH(words,w){ if (w->len == len && w->font == fn && fi->size == w->size && - (w->str == in_ss)){ + (w->str == in_text || memcmp(w->str,in_text,len) == 0)){ words = eina_inlist_promote(words, EINA_INLIST_GET(w)); - eina_stringshare_del(in_ss); LKU(lock_words); return w; } @@ -895,7 +893,7 @@ evas_font_word_prerender(RGBA_Draw_Context *dc, const char *in_text, int len, RG save = malloc(sizeof(struct prword)); save->cinfo = metrics; - save->str = in_ss; + save->str = eina_stringshare_add(in_text); save->font = fn; save->size = fi->size; save->len = len;