forked from enlightenment/efl
edje: another O(1) lookup, but for alias of group.
This give a small 10% benefit on Tizen theme. SVN revision: 76428
This commit is contained in:
parent
2127cab57d
commit
b3739ac5d6
|
@ -609,3 +609,4 @@
|
||||||
2012-09-11 Cedric Bail
|
2012-09-11 Cedric Bail
|
||||||
|
|
||||||
* O(1) lookup used when searching Part_Lookup in edje_cc.
|
* O(1) lookup used when searching Part_Lookup in edje_cc.
|
||||||
|
* O(1) lookup when generating alias of group.
|
||||||
|
|
|
@ -12,6 +12,7 @@ Additions:
|
||||||
Improvements:
|
Improvements:
|
||||||
* Check the number of parameter for image in edc.
|
* Check the number of parameter for image in edc.
|
||||||
* O(1) lookup used when searching Part_Lookup in edje_cc.
|
* O(1) lookup used when searching Part_Lookup in edje_cc.
|
||||||
|
* O(1) lookup when generating alias of group.
|
||||||
|
|
||||||
Fixes:
|
Fixes:
|
||||||
|
|
||||||
|
|
|
@ -240,6 +240,7 @@ extern Eina_List *stack;
|
||||||
extern Eina_List *params;
|
extern Eina_List *params;
|
||||||
extern Edje_File *edje_file;
|
extern Edje_File *edje_file;
|
||||||
extern Eina_List *edje_collections;
|
extern Eina_List *edje_collections;
|
||||||
|
extern Eina_Hash *edje_collections_lookup;
|
||||||
extern Eina_List *externals;
|
extern Eina_List *externals;
|
||||||
extern Eina_List *fonts;
|
extern Eina_List *fonts;
|
||||||
extern Eina_List *codes;
|
extern Eina_List *codes;
|
||||||
|
|
|
@ -1959,7 +1959,10 @@ static void
|
||||||
ob_collections(void)
|
ob_collections(void)
|
||||||
{
|
{
|
||||||
if (!edje_file->collection)
|
if (!edje_file->collection)
|
||||||
|
{
|
||||||
edje_file->collection = eina_hash_string_small_new(NULL);
|
edje_file->collection = eina_hash_string_small_new(NULL);
|
||||||
|
edje_collections_lookup = eina_hash_int32_new(NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2219,6 +2222,8 @@ ob_collections_group(void)
|
||||||
current_de = mem_alloc(SZ(Edje_Part_Collection_Directory_Entry));
|
current_de = mem_alloc(SZ(Edje_Part_Collection_Directory_Entry));
|
||||||
current_de->id = eina_list_count(edje_collections);
|
current_de->id = eina_list_count(edje_collections);
|
||||||
|
|
||||||
|
eina_hash_add(edje_collections_lookup, ¤t_de->id, current_de);
|
||||||
|
|
||||||
pc = mem_alloc(SZ(Edje_Part_Collection));
|
pc = mem_alloc(SZ(Edje_Part_Collection));
|
||||||
edje_collections = eina_list_append(edje_collections, pc);
|
edje_collections = eina_list_append(edje_collections, pc);
|
||||||
pc->id = current_de->id;
|
pc->id = current_de->id;
|
||||||
|
|
|
@ -183,6 +183,7 @@ static void data_process_string(Edje_Part_Collection *pc, const char *prefix, ch
|
||||||
|
|
||||||
Edje_File *edje_file = NULL;
|
Edje_File *edje_file = NULL;
|
||||||
Eina_List *edje_collections = NULL;
|
Eina_List *edje_collections = NULL;
|
||||||
|
Eina_Hash *edje_collections_lookup = NULL;
|
||||||
Eina_List *externals = NULL;
|
Eina_List *externals = NULL;
|
||||||
Eina_List *fonts = NULL;
|
Eina_List *fonts = NULL;
|
||||||
Eina_List *codes = NULL;
|
Eina_List *codes = NULL;
|
||||||
|
@ -371,7 +372,6 @@ data_thread_head(void *data, Ecore_Thread *thread __UNUSED__)
|
||||||
EINA_LIST_FREE(aliases, ce)
|
EINA_LIST_FREE(aliases, ce)
|
||||||
{
|
{
|
||||||
Edje_Part_Collection_Directory_Entry *sce;
|
Edje_Part_Collection_Directory_Entry *sce;
|
||||||
Eina_Iterator *it;
|
|
||||||
|
|
||||||
if (!ce->entry)
|
if (!ce->entry)
|
||||||
{
|
{
|
||||||
|
@ -381,18 +381,12 @@ data_thread_head(void *data, Ecore_Thread *thread __UNUSED__)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
it = eina_hash_iterator_data_new(edje_file->collection);
|
sce = eina_hash_find(edje_collections_lookup, &ce->id);
|
||||||
|
if (sce)
|
||||||
EINA_ITERATOR_FOREACH(it, sce)
|
|
||||||
{
|
|
||||||
if (ce->id == sce->id)
|
|
||||||
{
|
{
|
||||||
memcpy(&ce->count, &sce->count, sizeof (ce->count));
|
memcpy(&ce->count, &sce->count, sizeof (ce->count));
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
|
||||||
if (!sce)
|
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf),
|
snprintf(buf, sizeof(buf),
|
||||||
"Collection %s (%i) can't find an correct alias.",
|
"Collection %s (%i) can't find an correct alias.",
|
||||||
|
@ -400,7 +394,7 @@ data_thread_head(void *data, Ecore_Thread *thread __UNUSED__)
|
||||||
hw->errstr = strdup(buf);
|
hw->errstr = strdup(buf);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
eina_iterator_free(it);
|
|
||||||
eina_hash_direct_add(edje_file->collection, ce->entry, ce);
|
eina_hash_direct_add(edje_file->collection, ce->entry, ce);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue