Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Optimization Killers

DZone's Guide to

Optimization Killers

· Performance Zone
Free Resource

Here's a neat resource: Githubber bergus took a careful look at some Javascript optimization killers, particularly with respect to the V8 engine. 

In V8 there is no interpreter but there are 2 different compilers: generic and optimizing. That means your Javascript is always compiled and run directly as native code. That means it's fast, right? Wrong. Code being compiled to native code by itself isn't hugely significant for performance. It just removes interpreter overhead but the code will still be slow if not optimized.

Bergus outlines some ways to avoid missing optimization when coding, including tooling, finding workarounds in your code, working with arguments and avoiding certain functions that are unoptimizable in V8. 

Although the article only address one engine and does not consider working in browsers other than Chrome, it provides some helpful food for thought when approaching Javascript optimization in other places as well.

Check it out on Github.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}