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 73d3581f0b2acd8108887bddb694056b6c3676be
Author: Cedric BAIL <[email protected]>
AuthorDate: Mon Nov 9 17:15:33 2026 -0600

    ecore: boolean_model: do not move default bits when a row comes in
    
    Every child,added moved each boolean one place for all rows after the
    insertion point, one tree lookup per bit, stored or not, so filling a
    list from the front took time in proportion to the square of its length.
    
    Nothing past the last stored range is anything but the default, and that
    is also what moves onto it, so start the move at the end of what is
    stored. Measured by putting rows at the front of a Select_Model, 10000
    and then 20000 of them (plain build, same machine):
    
                           10000 rows   20000 rows
       before this change    0.525 s      1.675 s
       after this change     0.218 s      0.454 s
    
    The values of the bits are covered by efl_test_boolean_model_insert and
    efl_test_boolean_model_many.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 src/lib/ecore/efl_boolean_model.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/lib/ecore/efl_boolean_model.c b/src/lib/ecore/efl_boolean_model.c
index 476a225a45..f9bd82377a 100644
--- a/src/lib/ecore/efl_boolean_model.c
+++ b/src/lib/ecore/efl_boolean_model.c
@@ -329,11 +329,19 @@ _child_added(void *data, const Efl_Event *event)
    it = eina_hash_iterator_data_new(pd->values);
    EINA_ITERATOR_FOREACH(it, v)
      {
-        unsigned int i;
+        unsigned int i, stored;
+
+        // Past the last stored range every bit is the default, and so is the one
+        // that moves onto it: only what is stored has to be moved.
+        stored = (v->last) ? (v->last->offset + v->last->length) : 0;
+        i = total - 1;
+        if (i > stored) i = stored;
 
         // Everything from the insertion point is now one child further
-        for (i = total - 1; i > ev->index; i--)
-          _value_bit_set(v, i, _value_bit_get(v, i - 1));
+        for (; i > ev->index; i--)
+          {
+             _value_bit_set(v, i, _value_bit_get(v, i - 1));
+          }
         _value_bit_set(v, ev->index, !!v->default_value);
      }
    eina_iterator_free(it);

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

Reply via email to