A few hot-spot optimizations mostly related to heap allocation:
Iterating allChildren and directChildren from LayoutPage should be faster and use much less memory by storing these as arrays instead of having to iterate a Map. A consequence is that removing nodes is a little more cpu-intensive.
Using pickDirectChildren with a restriction (selecting a single row) for RepeatingChildrenPlugin now just returns the list of node-ids for that row directly and no longer needs to allocate a new array and loop through all of the other rows.
Reduce the number of array/object allocations in setRowExtras.
Avoid reading the context twice in useCtx() to check if it is provided or not. Believe it or not, but this showed up for memory allocation when profiling, and its a very easy win.
Related Issue(s)
closes #{issue number}
Verification/QA
Manual functionality testing
[x] I have tested these changes manually
[ ] Creator of the original issue (or service owner) has been contacted for manual testing (or will be contacted when released in alpha)
[ ] No testing done/necessary
Automated tests
[ ] Unit test(s) have been added/updated
[ ] Cypress E2E test(s) have been added/updated
[x] No automatic tests are needed here (no functional changes/additions)
Description
A few hot-spot optimizations mostly related to heap allocation:
allChildren
anddirectChildren
fromLayoutPage
should be faster and use much less memory by storing these as arrays instead of having to iterate aMap
. A consequence is that removing nodes is a little more cpu-intensive.pickDirectChildren
with arestriction
(selecting a single row) forRepeatingChildrenPlugin
now just returns the list of node-ids for that row directly and no longer needs to allocate a new array and loop through all of the other rows.setRowExtras
.useCtx()
to check if it is provided or not. Believe it or not, but this showed up for memory allocation when profiling, and its a very easy win.Related Issue(s)
Verification/QA
kind/*
label to this PR for proper release notes grouping