Use memcmp instead of stringshare. Much faster.
authornash <nash@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 26 Jul 2010 03:17:40 +0000 (03:17 +0000)
committernash <nash@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 26 Jul 2010 03:17:40 +0000 (03:17 +0000)
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%

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@50498 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/engines/common/evas_font_draw.c

index 8e9c3ea..e177cac 100644 (file)
@@ -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;