eo: Use COW to save 8~16 bytes per object

Desktop / Enlightenment / EFL Core Libraries - Jean-Philippe Andre [samsung.com] - 18 April 2017 05:52 EDT

Summary: This uses Eina_Cow to implement support for rarely used features in EO objects. This covers:- composite objects (eg. UI widgets: combobox, text, video, win)- vtable for efl_object_override- del_intercept

All of these features are quite tricky to get right and while
very useful, should still be used with great care. With this patch, the size of an _Eo_Object struct comes down from 80 bytes (rounded up from 72b) to 64 bytes (rounded up from 56b) on 64 bits.

Also I haven't measured precisely but I don't expect any performance impact since the COW data is more likely to remain in L1/L2 cache, as the default one will be used most often. Unfortunately, the results of "make benchmark" have been quite inconsistent over multiple runs.

This saves ~64kb in elementary_test (>4k objects) at the cost of ~100 calls to COW write (del intercept on some events).

@optimization

Reviewers: raster, cedric

Differential Revision: https://phab.enlightenment.org/D4796

86d1f2b eo: Use COW to save 8~16 bytes per object
src/lib/eo/eo.c | 84 ++++++++++++++++++++++++++--------------------
src/lib/eo/eo_base_class.c | 19 ++++++++---
src/lib/eo/eo_private.h | 33 +++++++++++++-----
3 files changed, 87 insertions(+), 49 deletions(-)

Upstream: git.enlightenment.org


  • Share