Rich-Harris / estree-walker

Traverse an ESTree-compliant AST
MIT License
389 stars 37 forks source link

Remove `childKeys` caching #14

Closed mrkishi closed 4 years ago

mrkishi commented 4 years ago

With some simple benchmarking, on my machine under regular load, I got ~20-22ms per walk() on Svelte's AST.

Without the cache with a for (const [key, value] of Object.entries(node)), it went to the ~150ms. With a regular for (const key in node), it went back to ~20ms. With a small micro-optimization, it looped straight up faster for me: ~17-19ms.

Conduitry commented 4 years ago

Is sander still used for anything with the tidying of the types generation?

Rich-Harris commented 4 years ago

nice, thanks 👍

re sander — doesn't look like it, removing

Rich-Harris commented 4 years ago

published 1.0.0