-
Notifications
You must be signed in to change notification settings - Fork 50
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
Let's discuss LinkContext #154
Comments
On 1: the documentation states if context isn't present, functions that consume it should treat this as On 2: yes, that's accurate. On the other hand: hasn't been a problem yet. And having On 3/performance: potentially, but I kind of want to see a benchmark showing us this is a problem. My current bet is that even as a fairly large pass-by-value, it's not going to end up in the top of the list of first optimization targets. (I'm more betting we're going to see Path concatenations during traversal operations are terrible alloc monsters that dwarf this, for instance.) On the other hand for performance: if we do turn out to want any of these values it's passing down, having this struct in here means we have a place do it while avoiding the need to do a construction of a new ParentNode could probably go. There's a comment about that already. I'd be easily convinced; there just hasn't been enough of an impetus to make me actively pursue throwing it out yet. I'm sort of surprised LinkPath doesn't get much use. I figured it would be useful for debug printfs, if nothing else. All in all, I do agree this could do with a review pass. If we do change anything I'd probably line that up to be a "v0.11" thing (i.e. slightly down the road, chronologically; if we do any breaking API changes here, I'd like it to be after a cooldown period since we just did the LinkSystem ones). |
That doesn't really change anything. Any API that requires a "if nil, make it not nil" dance is bad. One simple solution is to make the context private, add a
Sure, but can we just get rid of it? Do we really need it?
This kind of stuff should just go into a normal context as it's optional and we don't really need it. There's no reason for a custom context. So, my question is why? Do we really need this? If not, please drop it. If so, please explain why. Having a grab-bag "because maybe we'll need it" argument is really nasty. |
As far as I can tell, we only use LinkNode. And we only use that to set the
LinkTragetNodePrototypeChooser
which could probably be explicitly set.So, I'd very, VERY much like to get rid of this or at the very least pair it down and document it extensively.
The text was updated successfully, but these errors were encountered: