we already have" [commit id :
51638afbebc225b5a550eb87a0e74c53d866ed2e]
evas render - drop eo overhead by using ptrs we already have
several calls, specifically evas_object_change_reset,
evas_object_cur_prev, and evas_object_clip_changes_clean that are
called directly or indirectly as part of evas render on at least
every
active object if not more, were doing full eo obj lookups when their
calling functions already all had the eo protected data looked up.
tha's silly and just adds overhead we don't need. my test dropped
_eo_obj_pointer_get overhead in perf profiles from 4.48% to 2.65%.
see:
4.48% libeo.so.1.18.99 [.] _eo_obj_pointer_get
4.23% libevas.so.1.18.99 [.]
evas_render_updates_internal
2.61% libevas.so.1.18.99 [.]
evas_render_updates_internal_loop
1.68% libeo.so.1.18.99 [.] efl_data_scope_get
1.57% libc-2.24.so [.] _int_malloc
1.42% libevas.so.1.18.99 [.]
evas_object_smart_changed_get
1.09% libevas.so.1.18.99 [.]
evas_object_clip_recalc.part.37
1.08% libpthread-2.24.so [.] pthread_getspecific
1.05% libevas.so.1.18.99 [.]
efl_canvas_object_class_get
1.01% libevas.so.1.18.99 [.] evas_object_cur_prev
0.99% libeo.so.1.18.99 [.]
_efl_object_event_callback_legacy_call
0.87% libevas.so.1.18.99 [.]
_evas_render_phase1_object_ctx_render_cache_append
0.82% libpthread-2.24.so [.] pthread_mutex_lock
0.81% libevas.so.1.18.99 [.]
_evas_render_phase1_object_process
0.79% libc-2.24.so [.] _int_free
vs now the improved:
4.82% libevas.so.1.18.99 [.]
evas_render_updates_internal
3.44% libevas.so.1.18.99 [.]
evas_render_updates_internal_loop
2.65% libeo.so.1.18.99 [.] _eo_obj_pointer_get
2.22% libc-2.24.so [.] _int_malloc
1.46% libevas.so.1.18.99 [.]
evas_object_smart_changed_get
1.04% libeo.so.1.18.99 [.]
_efl_object_event_callback_legacy_call
1.03% libevas.so.1.18.99 [.]
_evas_render_phase1_object_ctx_render_cache_append
0.97% libeina.so.1.18.99 [.]
eina_chained_mempool_malloc
0.93% libevas.so.1.18.99 [.]
evas_object_clip_recalc.part.37
0.92% libpthread-2.24.so [.] pthread_mutex_lock
0.91% libevas.so.1.18.99 [.]
_evas_render_phase1_object_process
0.84% libc-2.24.so [.] _int_free
0.84% libevas.so.1.18.99 [.] evas_object_cur_prev
0.83% libeina.so.1.18.99 [.] eina_chained_mempool_free
0.80% libeo.so.1.18.99 [.] efl_data_scope_get
of course other things "increase their percentage" as oe overhead
now
dropped, and things seem to move around a bit, but it does make
sense
to do this with no downsides i can see as we already are accessing
the
protected data ptr in the parent func.
Change-Id: Iee7740df896537df047fac9fb0d33b450be9759f
}
static void
-evas_object_image_render_post(Evas_Object *eo_obj,
- Evas_Object_Protected_Data *obj EINA_UNUSED,
+evas_object_image_render_post(Evas_Object *eo_obj EINA_UNUSED,
+ Evas_Object_Protected_Data *obj ,
void *type_private_data)
{
Evas_Image_Data *o = type_private_data;
/* in whatever way is safest for the object. also if we don't need object */
/* data anymore we can free it if the object deems this is a good idea */
/* remove those pesky changes */
- evas_object_clip_changes_clean(eo_obj);
+ evas_object_clip_changes_clean(obj);
if (o->pixels->pixel_updates)
{
}
/* move cur to prev safely for object data */
- evas_object_cur_prev(eo_obj);
+ evas_object_cur_prev(obj);
eina_cow_memcpy(evas_object_image_state_cow, (const Eina_Cow_Data **) &o->prev, o->cur);
/* FIXME: copy strings across */
}
}
static void
-evas_object_line_render_post(Evas_Object *eo_obj,
- Evas_Object_Protected_Data *obj EINA_UNUSED,
+evas_object_line_render_post(Evas_Object *eo_obj EINA_UNUSED,
+ Evas_Object_Protected_Data *obj ,
void *type_private_data)
{
Evas_Line_Data *o = type_private_data;
/* in whatever way is safest for the object. also if we don't need object */
/* data anymore we can free it if the object deems this is a good idea */
/* remove those pesky changes */
- evas_object_clip_changes_clean(eo_obj);
+ evas_object_clip_changes_clean(obj);
/* move cur to prev safely for object data */
- evas_object_cur_prev(eo_obj);
+ evas_object_cur_prev(obj);
o->prev = o->cur;
}
}
void
-evas_object_change_reset(Evas_Object *eo_obj)
+evas_object_change_reset(Evas_Object_Protected_Data *obj)
{
- Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, MY_CLASS);
if (!obj) return;
obj->changed = EINA_FALSE;
obj->changed_move = EINA_FALSE;
}
void
-evas_object_cur_prev(Evas_Object *eo_obj)
+evas_object_cur_prev(Evas_Object_Protected_Data *obj)
{
- Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, MY_CLASS);
if (!obj) return;
if (!obj->map->prev.valid_map && obj->map->prev.map)
{
if (obj->clip.clipees)
obj->clip.clipees = eina_list_free(obj->clip.clipees);
obj->clip.cache_clipees_answer = eina_list_free(obj->clip.cache_clipees_answer);
- evas_object_clip_changes_clean(eo_obj);
+ evas_object_clip_changes_clean(obj);
evas_object_event_callback_all_del(eo_obj);
evas_object_event_callback_cleanup(eo_obj);
if (obj->map->spans)
}
void
-evas_object_clip_changes_clean(Evas_Object *eo_obj)
+evas_object_clip_changes_clean(Evas_Object_Protected_Data *obj)
{
- Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, MY_CLASS);
if (!obj) return;
Eina_Rectangle *r;
{
/* This is a clipper object: add regions that changed here,
* See above: EINA_LIST_FOREACH(clipper->clip.changes) */
- evas_object_clip_changes_clean(eo_obj);
+ evas_object_clip_changes_clean(obj);
EINA_ARRAY_ITER_NEXT(rects, i, r, it)
obj->clip.changes = eina_list_append(obj->clip.changes, r);
eina_array_clean(rects);
}
static void
-evas_object_polygon_render_post(Evas_Object *eo_obj,
- Evas_Object_Protected_Data *obj EINA_UNUSED,
+evas_object_polygon_render_post(Evas_Object *eo_obj EINA_UNUSED,
+ Evas_Object_Protected_Data *obj,
void *type_private_data EINA_UNUSED)
{
/* this moves the current data to the previous state parts of the object */
/* in whatever way is safest for the object. also if we don't need object */
/* data anymore we can free it if the object deems this is a good idea */
/* remove those pesky changes */
- evas_object_clip_changes_clean(eo_obj);
+ evas_object_clip_changes_clean(obj);
/* move cur to prev safely for object data */
- evas_object_cur_prev(eo_obj);
+ evas_object_cur_prev(obj);
}
static unsigned int evas_object_polygon_id_get(Evas_Object *eo_obj)
}
static void
-evas_object_rectangle_render_post(Evas_Object *eo_obj,
- Evas_Object_Protected_Data *obj EINA_UNUSED,
+evas_object_rectangle_render_post(Evas_Object *eo_obj EINA_UNUSED,
+ Evas_Object_Protected_Data *obj ,
void *type_private_data EINA_UNUSED)
{
/* in whatever way is safest for the object. also if we don't need object */
/* data anymore we can free it if the object deems this is a good idea */
/* remove those pesky changes */
- evas_object_clip_changes_clean(eo_obj);
+ evas_object_clip_changes_clean(obj);
/* move cur to prev safely for object data */
- evas_object_cur_prev(eo_obj);
+ evas_object_cur_prev(obj);
}
static int
}
static void
-evas_object_smart_render_post(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED, void *type_private_data)
+evas_object_smart_render_post(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj , void *type_private_data)
{
Evas_Smart_Data *o = type_private_data;
- evas_object_cur_prev(eo_obj);
+ evas_object_cur_prev(obj);
o->prev = o->cur;
}
}
static void
-evas_object_text_render_post(Evas_Object *eo_obj,
- Evas_Object_Protected_Data *obj EINA_UNUSED,
+evas_object_text_render_post(Evas_Object *eo_obj EINA_UNUSED,
+ Evas_Object_Protected_Data *obj ,
void *type_private_data EINA_UNUSED)
{
/* this moves the current data to the previous state parts of the object
in whatever way is safest for the object. also if we don't need object
data anymore we can free it if the object deems this is a good idea */
/* remove those pesky changes */
- evas_object_clip_changes_clean(eo_obj);
+ evas_object_clip_changes_clean(obj);
/* move cur to prev safely for object data */
- evas_object_cur_prev(eo_obj);
+ evas_object_cur_prev(obj);
}
static unsigned int
}
static void
-evas_object_textblock_render_post(Evas_Object *eo_obj,
- Evas_Object_Protected_Data *obj EINA_UNUSED,
+evas_object_textblock_render_post(Evas_Object *eo_obj EINA_UNUSED,
+ Evas_Object_Protected_Data *obj ,
void *type_private_data EINA_UNUSED)
{
/* Evas_Textblock_Data *o; */
/* data anymore we can free it if the object deems this is a good idea */
/* o = (Evas_Textblock_Data *)(obj->object_data); */
/* remove those pesky changes */
- evas_object_clip_changes_clean(eo_obj);
+ evas_object_clip_changes_clean(obj);
/* move cur to prev safely for object data */
- evas_object_cur_prev(eo_obj);
+ evas_object_cur_prev(obj);
/* o->prev = o->cur; */
}
}
static void
-evas_object_textgrid_render_post(Evas_Object *eo_obj,
- Evas_Object_Protected_Data *obj EINA_UNUSED,
+evas_object_textgrid_render_post(Evas_Object *eo_obj EINA_UNUSED,
+ Evas_Object_Protected_Data *obj ,
void *type_private_data)
{
/* this moves the current data to the previous state parts of the object */
/* data anymore we can free it if the object deems this is a good idea */
Evas_Textgrid_Data *o = type_private_data;
/* remove those pesky changes */
- evas_object_clip_changes_clean(eo_obj);
+ evas_object_clip_changes_clean(obj);
/* move cur to prev safely for object data */
- evas_object_cur_prev(eo_obj);
+ evas_object_cur_prev(obj);
o->prev = o->cur;
while (eina_array_count(&o->glyphs_cleanup) > 0)
}
static void
-evas_object_vg_render_post(Evas_Object *eo_obj,
- Evas_Object_Protected_Data *obj EINA_UNUSED,
+evas_object_vg_render_post(Evas_Object *eo_obj EINA_UNUSED,
+ Evas_Object_Protected_Data *obj ,
void *type_private_data EINA_UNUSED)
{
/* this moves the current data to the previous state parts of the object */
/* in whatever way is safest for the object. also if we don't need object */
/* data anymore we can free it if the object deems this is a good idea */
/* remove those pesky changes */
- evas_object_clip_changes_clean(eo_obj);
+ evas_object_clip_changes_clean(obj);
/* move cur to prev safely for object data */
- evas_object_cur_prev(eo_obj);
+ evas_object_cur_prev(obj);
}
static unsigned int
by the current (hidden) state. */
if (evas_object_is_visible(eo_obj, obj) !=
evas_object_was_visible(eo_obj, obj))
- evas_object_cur_prev(eo_obj);
+ evas_object_cur_prev(obj);
RD(level, " skip - not smart, not active or clippees or not relevant\n");
}
RD(0, "] pending change %i -> 0, pre %i\n", obj->changed, obj->pre_render_done);
obj->func->render_post(eo_obj, obj, obj->private_data);
obj->pre_render_done = EINA_FALSE;
- evas_object_change_reset(eo_obj);
+ evas_object_change_reset(obj);
}
else if (!_evas_render_can_render(eo_obj, obj) &&
(!obj->is_active) && (!obj->render_pre) &&
(!obj->rect_del))
{
- evas_object_change_reset(eo_obj);
+ evas_object_change_reset(obj);
}
if (!obj->changed) eo_data_unref(eo_obj, obj);
return obj->changed ? EINA_TRUE : EINA_FALSE;
push this object in an array then reset them
in the end of the rendering.*/
if (!proxy_render_data)
- evas_object_change_reset(obj2->object);
+ evas_object_change_reset(obj2);
}
}
else
push this object in an array then reset them
in the end of the rendering.*/
if (!proxy_render_data)
- evas_object_change_reset(obj2->object);
+ evas_object_change_reset(obj2);
}
}
else
RD(0, "] render_post()\n");
obj->func->render_post(eo_obj, obj, obj->private_data);
obj->restack = EINA_FALSE;
- evas_object_change_reset(eo_obj);
+ evas_object_change_reset(obj);
}
/* moved to other pre-process phase 1
if (obj->delete_me == 2)
{
obj->func->render_post(eo_obj, obj, obj->private_data);
obj->restack = EINA_FALSE;
- evas_object_change_reset(eo_obj);
+ evas_object_change_reset(obj);
}
}
updates, offx, offy);
if (obj->changed)
{
- evas_object_clip_changes_clean(eo_obj);
- evas_object_cur_prev(eo_obj);
- evas_object_change_reset(eo_obj);
+ evas_object_clip_changes_clean(obj);
+ evas_object_cur_prev(obj);
+ evas_object_change_reset(obj);
}
}
offx, offy, l + 1);
if (obj->changed)
{
- evas_object_clip_changes_clean(eo_obj);
- evas_object_cur_prev(eo_obj);
- evas_object_change_reset(eo_obj);
+ evas_object_clip_changes_clean(obj);
+ evas_object_cur_prev(obj);
+ evas_object_change_reset(obj);
}
}
else _evas_render2_th_main_obj_basic_walk_process(e, obj, updates,
obj->func->render_post(eo_obj, obj, obj->private_data);
obj->restack = EINA_FALSE;
obj->pre_render_done = EINA_FALSE;
- evas_object_change_reset(eo_obj);
+ evas_object_change_reset(obj);
}
static void
obj->func->render_post(eo_obj, obj, obj->private_data);
obj->restack = EINA_FALSE;
obj->pre_render_done = EINA_FALSE;
- evas_object_change_reset(eo_obj);
+ evas_object_change_reset(obj);
}
else _obj_basic_process(e, obj, l);
}
#endif
Evas_Object *evas_object_new(Evas *e);
-void evas_object_change_reset(Evas_Object *obj);
-void evas_object_cur_prev(Evas_Object *obj);
+void evas_object_change_reset(Evas_Object_Protected_Data *obj);
+void evas_object_cur_prev(Evas_Object_Protected_Data *obj);
void evas_object_free(Evas_Object *obj, int clean_layer);
void evas_object_update_bounding_box(Evas_Object *obj, Evas_Object_Protected_Data *pd);
void evas_object_inject(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas *e);
void evas_object_release(Evas_Object *obj, Evas_Object_Protected_Data *pd, int clean_layer);
void evas_object_change(Evas_Object *obj, Evas_Object_Protected_Data *pd);
void evas_object_content_change(Evas_Object *obj, Evas_Object_Protected_Data *pd);
-void evas_object_clip_changes_clean(Evas_Object *obj);
+void evas_object_clip_changes_clean(Evas_Object_Protected_Data *obj);
void evas_object_render_pre_visible_change(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v);
void evas_object_render_pre_clipper_change(Eina_Array *rects, Evas_Object *obj);
void evas_object_render_pre_prev_cur_add(Eina_Array *rects, Evas_Object *obj, Evas_Object_Protected_Data *pd);