This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository efl.

View the commit online.

commit 35d55d5357c17863ab80649e5c2d5ebb65221fd2
Author: Cedric BAIL <[email protected]>
AuthorDate: Tue Nov 10 18:37:59 2026 -0600

    elementary: exact_model: only recompress an evicted slot written to
    
    A slot that left the cache was compressed back into the list whether it
    was written to or not, and compressing is the expensive half. Read-only
    visits (the view asking the size of every row) paid it at each eviction.
    Keep a dirty flag per slot and direction, set by the property writes,
    and commit only those.
    
    Measured with a throwaway test reading "self.height" in a loop of rows
    that sit in four different blocks of 1024, so that every read evicts a
    slot of the three the model has, 80000 reads (plain build, same machine,
    three runs each, the runs within 1% of each other):
    
                                  time
       before this change       341 ms
       after this change        200 ms
    
    The existing efl_ui_exact_model_many_rows reads back every value after
    slots were evicted, and fails when a written slot is not committed.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 src/lib/elementary/efl_ui_exact_model.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/efl_ui_exact_model.c b/src/lib/elementary/efl_ui_exact_model.c
index 453c4e691e..eb363696a2 100644
--- a/src/lib/elementary/efl_ui_exact_model.c
+++ b/src/lib/elementary/efl_ui_exact_model.c
@@ -45,6 +45,11 @@ struct _Efl_Ui_Exact_Model_Data
          Eina_Bool width : 1;
          Eina_Bool height : 1;
       } decompressed;
+      // Written to since it was expanded: what the compressed list has is older
+      struct {
+         Eina_Bool width : 1;
+         Eina_Bool height : 1;
+      } dirty;
    } slot[3];
 };
 
@@ -250,13 +255,16 @@ _efl_ui_exact_model_slot_find(Efl_Ui_Exact_Model_Data *root, unsigned int index,
              // (written back under the block it holds, not the one that evicts it)
              unsigned int block = root->slot[found].start_offset;
 
+             // (a slot that was only read has nothing to commit)
              if (root->slot[found].width &&
-                 root->slot[found].decompressed.width)
+                 root->slot[found].decompressed.width &&
+                 root->slot[found].dirty.width)
                root->compressed.width =
                  _efl_ui_exact_model_slot_compress(block, root->compressed.width,
                                                    root->slot[found].width);
              if (root->slot[found].height &&
-                 root->slot[found].decompressed.height)
+                 root->slot[found].decompressed.height &&
+                 root->slot[found].dirty.height)
                root->compressed.height =
                  _efl_ui_exact_model_slot_compress(block, root->compressed.height,
                                                    root->slot[found].height);
@@ -265,6 +273,8 @@ _efl_ui_exact_model_slot_find(Efl_Ui_Exact_Model_Data *root, unsigned int index,
         root->slot[found].defined = EINA_TRUE;
         root->slot[found].decompressed.width = EINA_FALSE;
         root->slot[found].decompressed.height = EINA_FALSE;
+        root->slot[found].dirty.width = EINA_FALSE;
+        root->slot[found].dirty.height = EINA_FALSE;
         root->slot[found].start_offset = index / EFL_UI_EXACT_MODEL_CONTENT;
      }
 
@@ -310,6 +320,7 @@ _efl_ui_exact_model_efl_model_property_set(Eo *obj, Efl_Ui_Exact_Model_Data *pd,
               return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE);
             pd->parent->slot[found].width[index % EFL_UI_EXACT_MODEL_CONTENT] =
               size | EFL_UI_EXACT_MODEL_MEASURED;
+            pd->parent->slot[found].dirty.width = EINA_TRUE;
             // We succeeded so let's update the max total size width (As we only handle vertical list case at the moment)
             if (pd->parent->total_size.width < size)
               pd->parent->total_size.width = size;
@@ -331,6 +342,7 @@ _efl_ui_exact_model_efl_model_property_set(Eo *obj, Efl_Ui_Exact_Model_Data *pd,
             if (!eina_value_uint_convert(value, &size) || (size & EFL_UI_EXACT_MODEL_MEASURED))
               return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE);
             *cell = size | EFL_UI_EXACT_MODEL_MEASURED;
+            pd->parent->slot[found].dirty.height = EINA_TRUE;
             // We succeeded so let's update the total size
             pd->parent->total_size.height += size - old_value;
             return efl_loop_future_resolved(obj, eina_value_uint_init(size));

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to