-
Notifications
You must be signed in to change notification settings - Fork 12
feat: add memoization to when converting a graph into a tree #73
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
Conversation
Does this just allocate forever? |
No, it's a scoped function, GC will clean function a(b = new Map()) { return b; }
assert.notEqual(a(), a()); // true |
This looks cool @admons! Any idea on the impact? |
@robcresswell thanks :)
|
@admons Ah sorry I should've been more specific. I got the overall idea; I meant rather if you'd been able to benchmark anything. Just out of curiosity than anything else 🤓 |
@robcresswell :) |
Niiice, thats what I wanted to hear 🤓 |
9246e26
to
edf048f
Compare
edf048f
to
113746f
Compare
🎉 |
🎉 This PR is included in version 1.21.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What does this PR do?
It adds memoization in the
graphToDepTree
This will result in reused objects in a tree instead, for example the following graph
Instead of creating
B --> D
twice (as today), it will reuse the B subtree