Another tip - Again, measure, but this one I know is true, and measured before writing this post, and have provided c3p to share.
You can get a higher-performant For Each by using... Return functions! (Again MEASUREEEEE for your case!).
Explaination
Much like how you can do "Sprite n > 5, set Sprite opacity", and it applies to each Sprite without needing a "For Each", you can utilise this by using return functions, as they too run for each Sprite, without needing "For Each".
I measured:
1000 sprites, 500 have n = 0, 500 have n = 10
Two test keyboard keys to hold:
A Key = Sprite n > 5 , For Each , Pick Child , Set child opacity to 55
S Key = Sprite n > 5 , Set Sprite dummyVar to Functions.DummyFunction(Sprite.UID)
DummyFunction: Pick Sprite by UID , Pick Sprite Child , Set child opacity to 55
Now, this seems wild - The "dummy return function" seems way more busy, and has to run a function, and pick the sprite via UID...
... But the results?:
For Each - CPU 13% (Unlocked Frames: 900fps)
Dummy Return - CPU 8% (Unlocked Frames: 1800fps)
MAGIC.
C3P below:
drive.google.com/file/d/17CTtsNiO59uh5h8pjgY_4kTNPj6ooRQI/view
(I would have included some clearer checks like a "Children updated" counter, but wanted it to be raw performance, but I quickly checked debugger for values being updated only for the last 500 children, and indeed it seems correct.)
(Note: Be careful before rushing to implement this everywhere. Whilst I am using this in places and haven't had issue, I have a fear of "reaching call stack", which you may have seen when you run a function too many times in 1 tick - Perhaps this gets reached if over-using functions per tick, although I am not sure.)