Get the latest tech news
Optimizing JavaScript for Fun and for Profit
romgrk's personal blog
A note on terminology I have used the word “shape” for this concept, but be aware that you may also find “hidden class” or “map” used to describe it, depending on the engine. If you’ve payed attention sooner, you will realize that the engine will specialize the function for the shape{ type: string, count: number }. The deoptexplorer-vscode extension allows you to load V8/chromium log files to understand when your code is triggering deoptimizations, such as when you pass different shapes to a function.
Or read this on Hacker News