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.
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 regularfor (const key in node)
, it went back to ~20ms. With a small micro-optimization, it looped straight up faster for me: ~17-19ms.