V8 Hidden Classes - Shapes and Inline Caches | IconVault

Visualize V8 hidden-class transitions and inline cache states: monomorphic, polymorphic, megamorphic. Interactive shape trees. Free.

All tools

V8 Hidden Classes

Shape transitions and inline-cache states

5 of 5 free uses left

V8 gives every object a hidden class describing its layout. Adding a property transitions the object to a new class. Add properties in the same order and objects share classes (fast); mix the order and each path gets its own class (slow). Toggle properties below to see the trees diverge.

Object A

C1

∅ empty

+x

C2

{ x }

+y

C3

{ x, y }

final class: C2 { x, y }

Object B

C1

∅ empty

+y

C2

{ y }

+x

C3

{ y, x }

final class: C2 { y, x }

Different order: the two objects land on different hidden classes. Every property access now has to handle both shapes.

Copyable example

// Different property order -> DIFFERENT hidden classes -> slower
function makeA() {
  const o = {};
  o.x = 0;
  o.y = 0;
  return o;
}
function makeB() {
  const o = {};
  o.y = 0;
  o.x = 0;
  return o;
}
// makeA() ends at C2 { x, y }
// makeB() ends at C2 { y, x } - a different class!

About this tool

IconVault's V8 Hidden Classes visualizer reveals the optimization hiding inside every JavaScript object. Build two objects with different property orders and watch their hidden-class transition trees diverge: same order shares one class, mixed orders fork into slower shapes, with a copyable code example to prove it.

Then explore inline caching: slide from one shape to eight and watch the call site degrade from monomorphic to polymorphic to megamorphic, with a plain-English report on what V8 does at each stage. Everything is free and runs fully in your browser.

Frequently asked questions

Popular searches

v8 hidden classeshidden classesjavascript hidden classv8 shapesshape transitionsinline cachinginline cachemonomorphicpolymorphicmegamorphicv8 optimizationjavascript performancejs engine optimizationv8 internalshow v8 worksjavascript object layoutproperty order performancev8 mapsv8 transitionsdictionary mode javascriptdelete operator slowjavascript fast propertiesslow properties v8v8 deoptimizationhidden class transitionslearn v8v8 visualizerjavascript performance tipsoptimize javascript objectsconstructor property orderinitialize properties constructorv8 inline cache explainedpolymorphic inline cachemegamorphic v8v8 feedbackturbofanignition interpreterjavascript jitjit compilation javascriptv8 blogunderstanding v8v8 object representationsmi v8elements kind v8packed vs holey arraysv8 arraysjavascript performance interviewv8 interview questionsnode performancev8 perfchrome devtools performancejavascript memory layoutobject shapesshape treev8 shapetransition tree v8prototype vs hidden class

More tools

Coming soon

CLI

Coming soon

Figma plugin

Coming soon

VS Code extension

Coming soon

Chrome extension

Coming soon

AI icon generator

Coming soon

Team workspaces

Coming soon

View all 10+ tools →