1: Can a react person explain something to me? People say that higher order components are faster than render props because they avoid
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
The function allocation argument is a weak one. An extra component in your hierarchy is going to be at least as expensive!
-
I agree re allocations, but don't you have the same number of component either way? Mouse is there in both designs, no?
-
Yep, my example doesn't illustrate this point very well. The difference is that it's not a decorator, so doesn't re-render the whole App.
-
fwiw I thought your talk was great! It motivates your design well, and gave me a crisper argument for Glimmer block params.
-
TLDR what's a higher order function if your function can't take arguments. What kind of functional programming is this?
-
Interesting. Yes, it's a different type of functional programming IMO, and one that encourages indirection.
-
Instead of putting things inline, we compose ahead of time. I call it "static" composition. It's different from dynamic nature of JSX.
-
Yeah. I bristled a little at that distinction, because Glimmer is very static but uses what you call "dynamic composition", but hey YOLO
- 2 more replies
New conversation -
-
-
I’m not sure why people believe individual allocations = poor perf. Each render allocates thousands of throwaway objects.
-
And many of them are optimized away!
-
Amortization + optimization = it's fine, people :-)
End of conversation
New conversation -
-
-
Yeah, hard to compare the allocation costs. My belief is that render functions do not allow receiving components to shouldComponentUpdate.
-
The render prop could close over variables that the child component cannot discern. Thus cannot accurately determine whether to re-render.
-
That being said, I think we've actually gone overboard with shouldComponentUpdate and HOC for
@asana. -
I want to run a perf experiment to see what happens when we remove it.
-
Ah! I wasn't thinking about this because Glimmer creates sCU automatically, so it handles the render prop case fine. Valid critique.
End of conversation
New conversation -
-
-
Also wondering about this. Is a closure supposedly cheaper than a whole component instance?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.