Refacto find to search id by tree level instead of by tree branch

This MR provides a new way to find in the sheet component tree. Previously, find() was doing the following : check if the first component has the good id, if not make the search in the children. If nothing found in the children, go to the next component. For large data repeaters, this creates a strong speed decrease as it unsuccessfully looks for the last "repeater element" in all the previous elements.

This refacto works differently : it search the id by tree level.

  • fist step : search the matching id in the direct children, and push a "search lineage" in a "working backlog".
  • if no direct child matches the id, we take the next "search lineage"
  • a "search lineage" is a list of component and their ancestors

I made this complex code because of the protected component _findCache.

Pros and cons :

  • +this code makes a more human logical search by tree-level, its result can seem more natural
  • +it has a large decrease of execution time on large repeaters
  • -the page load and init seem to be 10% slower than before on "clean sheet", but that concerns only short loading time (<1s). I considered it as acceptable. But needs to be largely tested.
Edited by Guile

Merge request reports

Loading