From 98092224ef6265f27cc6b8fd58da8ce8cf9850d3 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Mon, 20 Feb 2017 18:26:40 +0900 Subject: [PATCH] evas: Avoid more calls to efl_isa in clip_set No need to verify that the clip is an evas object unless we're actually going to change said clipper. This has a minor effect, removing ~10% of all calls to efl_isa (0.1% of everything). After all those efl_isa patches the number of calls has dropped from 1.9M (~3.05%) to ~570k (0.76%). More can still be done, surely. Now efl_isa accounts for ~0.05% of my CPU usage according to perf top (down from ~0.7%). If edje uses EO APIs instead of legacy image APIs, then many of the remaining calls will vanish. @optimization --- src/lib/evas/canvas/evas_clip.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/evas/canvas/evas_clip.c b/src/lib/evas/canvas/evas_clip.c index 494e13d..da761c3 100644 --- a/src/lib/evas/canvas/evas_clip.c +++ b/src/lib/evas/canvas/evas_clip.c @@ -324,6 +324,9 @@ _efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Ob EVAS_OBJECT_DATA_ALIVE_CHECK(obj); + if ((!obj->cur->clipper && !eo_clip) || + (obj->cur->clipper && obj->cur->clipper->object == eo_clip)) return; + clip = EVAS_OBJECT_DATA_SAFE_GET(eo_clip); if (!EVAS_OBJECT_DATA_ALIVE(clip)) { -- 2.7.4