forked from enlightenment/efl
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
This commit is contained in:
parent
31c6799a7e
commit
9357c5d284
|
@ -795,14 +795,12 @@ evas_font_word_prerender(RGBA_Draw_Context *dc, const char *in_text, int len, RG
|
||||||
struct prword *w;
|
struct prword *w;
|
||||||
int gl;
|
int gl;
|
||||||
|
|
||||||
const char *in_ss = eina_stringshare_add(in_text);
|
|
||||||
|
|
||||||
LKL(lock_words);
|
LKL(lock_words);
|
||||||
EINA_INLIST_FOREACH(words,w){
|
EINA_INLIST_FOREACH(words,w){
|
||||||
if (w->len == len && w->font == fn && fi->size == w->size &&
|
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));
|
words = eina_inlist_promote(words, EINA_INLIST_GET(w));
|
||||||
eina_stringshare_del(in_ss);
|
|
||||||
LKU(lock_words);
|
LKU(lock_words);
|
||||||
return w;
|
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 = malloc(sizeof(struct prword));
|
||||||
save->cinfo = metrics;
|
save->cinfo = metrics;
|
||||||
save->str = in_ss;
|
save->str = eina_stringshare_add(in_text);
|
||||||
save->font = fn;
|
save->font = fn;
|
||||||
save->size = fi->size;
|
save->size = fi->size;
|
||||||
save->len = len;
|
save->len = len;
|
||||||
|
|
Loading…
Reference in New Issue