Dear @v8js @SpiderMonkeyJS,
what is the cost of props destructuring and spreading and other common #reactjs idioms?
Does it yield lots of hidden classes, because we usually use different sets of props in diff order? And so the functions will always be megamorphic?
Why would destructuring result in “lots of different shapes”? Which “temporary objects” are you thinking of?
-
-
Let's say you have a <Button and sometimes you need to pass additional styles, classes, icon, etc. So the shape of props is different, at least in number of properties, sometimes even in their order. I don't know how modern VMs work under the hood so I'm just guessing.
-
Objects with different properties, or the same properties in a different order, have different shapes indeed. More info here: https://mathiasbynens.be/notes/shapes-ics … I don’t see how destructuring in particular makes this situation worse, though.
- 1 more reply
New conversation -
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.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.