Ever wondered if your code is optimized for V8's just-in-time compiler?
Here's a neat trick: use the Chrome DevTools. If V8 can "see" the structure ahead of time, that's a signal that you're on the right track.
Probably the easiest way to de-optimize your code is to use recursion. Recursion does not preserve structure.
And if you think about it, that makes sense. How could it? We'd need to solve the halting problem first.
Top comments (0)