bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=67cd017aac4a83a8f83f1ed84f3ea461c1c0b416

commit 67cd017aac4a83a8f83f1ed84f3ea461c1c0b416
Author: Marcel Hollerbach <m...@marcel-hollerbach.de>
Date:   Fri Jul 31 10:50:04 2020 +0200

    eo: evalulate special counts earlier
    
    we have these special counts which are > 0 when there is a callback
    subscribed. THey are currently evalulated in _callback_call. However,
    we can also skip the entire call from inside eo_base_class as we are
    having the fields there as well.
    
    This way we are skipping the obj pointer lookup and vtable lookup.
    
    Reviewed-by: Cedric BAIL <cedric.b...@free.fr>
    Differential Revision: https://phab.enlightenment.org/D12079
---
 src/lib/eo/eo_base_class.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 8132bcea58..bd394910c9 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -237,9 +237,9 @@ _efl_invalidate(_Eo_Object *obj)
 
    id = _eo_obj_id_get(obj);
 
-   efl_event_callback_call(id, EFL_EVENT_INVALIDATE, NULL);
-
    pd = efl_data_scope_get(id, EFL_OBJECT_CLASS);
+   if (pd->event_cb_EFL_EVENT_INVALIDATE)
+     efl_event_callback_call(id, EFL_EVENT_INVALIDATE, NULL);
 
    efl_invalidate(id);
 
@@ -1575,7 +1575,8 @@ _efl_object_event_callback_priority_add(Eo *obj, 
Efl_Object_Data *pd,
    _eo_callbacks_sorted_insert(pd, cb);
    _special_event_count_inc(obj, pd, &(cb->items.item));
 
-   efl_event_callback_call(obj, EFL_EVENT_CALLBACK_ADD, (void *)arr);
+   if (pd->event_cb_EFL_EVENT_CALLBACK_ADD)
+     efl_event_callback_call(obj, EFL_EVENT_CALLBACK_ADD, (void *)arr);
 
    return EINA_TRUE;
 
@@ -1601,8 +1602,8 @@ _efl_object_event_callback_clean(Eo *obj, Efl_Object_Data 
*pd,
      pd->need_cleaning = EINA_TRUE;
    else
      _eo_callback_remove(obj, pd, cb);
-
-   efl_event_callback_call(obj, EFL_EVENT_CALLBACK_DEL, (void *)array);
+   if (pd->event_cb_EFL_EVENT_CALLBACK_DEL)
+     efl_event_callback_call(obj, EFL_EVENT_CALLBACK_DEL, (void *)array);
 }
 
 EOLIAN static Eina_Bool
@@ -1729,7 +1730,8 @@ _efl_object_event_callback_array_priority_add(Eo *obj, 
Efl_Object_Data *pd,
    ev_array[i].priority = 0;
    ev_array[i].func = NULL;
    ev_array[i].user_data = NULL;
-   efl_event_callback_call(obj, EFL_EVENT_CALLBACK_ADD, ev_array);
+   if (pd->event_cb_EFL_EVENT_CALLBACK_ADD)
+     efl_event_callback_call(obj, EFL_EVENT_CALLBACK_ADD, ev_array);
 
    return EINA_TRUE;
 

-- 


Reply via email to