-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
♻️ improves merge proxies #3722
Conversation
Co-authored-by: Christian Taylor <christianbtaylor@gmail.com>
Thank you for this @ekwoka - do you have any benchmarks to go with it to more concretely demonstrate the benefits? Thanks! |
@calebporzio Sure thing. Here's some tests that basically just compares both So naturally The depth is used to generate a proxy out of that many objects, and similarly, in the accessing, it accesses a property on each of those objects within a So its 100k loops on a depth of 26, and 1M loops on a depth of 10. You can see the new one is basically always about 30% faster than the old in these test configuration So every time a property is accessed in an expression, this could make that up to 30% faster (deeper component trees will benefit more, smaller trees it's much more modest (around 3-5%). For memory, this script just puts that number of merged proxies into an array so we can actually measure the memory size (otherwise it's basically impossible to really tell) and the time in ms. So less memory can also have a performance impact (less garbage to collect). About 75% less memory per merged proxy (runtime memory was about 3mb so not meaningful to these measurements) |
Great, thank you for the extra context! |
This PR refactors
mergeProxies
to increase performance and reduce memory costs.