cedric pushed a commit to branch master.

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

commit bdd163fce85202e3cab0d269eda452e3ecd5b7c0
Author: Cedric BAIL <ced...@osg.samsung.com>
Date:   Mon Feb 1 15:46:50 2016 -0800

    evas: don't emit EVAS_CALLBACK_MOVE event if nobody is listening.
    
    This give a constant improvement of 2% over a total benchmark run while 
scrolling
    genlist. This benchmark included setup and destruction of the scene, so 
under
    estimate the cost of the callback emit.
---
 src/lib/evas/canvas/evas_callbacks.c   |  6 ++++++
 src/lib/evas/canvas/evas_object_main.c | 14 ++++++++------
 src/lib/evas/include/evas_private.h    |  1 +
 3 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/lib/evas/canvas/evas_callbacks.c 
b/src/lib/evas/canvas/evas_callbacks.c
index 2d36129..321101f 100644
--- a/src/lib/evas/canvas/evas_callbacks.c
+++ b/src/lib/evas/canvas/evas_callbacks.c
@@ -201,6 +201,11 @@ evas_object_event_callback_call(Evas_Object *eo_obj, 
Evas_Object_Protected_Data
    if (!(e = obj->layer->evas)) return;
 
    _evas_walk(e);
+
+   if (type == EVAS_CALLBACK_MOVE &&
+       obj->move_ref == 0)
+     goto nothing_here;
+
      {
         switch (type)
           {
@@ -248,6 +253,7 @@ evas_object_event_callback_call(Evas_Object *eo_obj, 
Evas_Object_Protected_Data
           }
      }
 
+ nothing_here:
    if (!obj->no_propagate)
      {
         if ((obj->smart.parent) && (type != EVAS_CALLBACK_FREE) &&
diff --git a/src/lib/evas/canvas/evas_object_main.c 
b/src/lib/evas/canvas/evas_object_main.c
index 21a180c..daf236c 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -117,10 +117,10 @@ _check_event_catcher_add(void *data,
                    
eo_event_callback_add(EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, 
_animator_repeater, obj));
              INF("Registering an animator tick on canvas %p for object %p.",
                  obj->layer->evas->evas, obj->object);
-
-             // No need to walk more than once per array as you can not del
-             // a partial array
-             break;
+          }
+        else if (array[i].desc == EVAS_OBJECT_EVENT_MOVE)
+          {
+             obj->move_ref++;
           }
      }
 
@@ -147,8 +147,10 @@ _check_event_catcher_del(void *data,
                    
eo_event_callback_del(EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, 
_animator_repeater, obj));
              INF("Unregistering an animator tick on canvas %p for object %p.",
                  obj->layer->evas->evas, obj->object);
-
-             break;
+          }
+        else if (array[i].desc == EVAS_OBJECT_EVENT_MOVE)
+          {
+             obj->move_ref--;
           }
      }
 
diff --git a/src/lib/evas/include/evas_private.h 
b/src/lib/evas/include/evas_private.h
index 28f890b..41fe143 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1073,6 +1073,7 @@ struct _Evas_Object_Protected_Data
    unsigned int                ref;
 
    unsigned int                animator_ref;
+   unsigned int                move_ref;
 
    unsigned char               delete_me;
 

-- 


Reply via email to