Microsoft is adding JavaScript performance improvements to the Chakra engine behind the Edge web browser, which will be available for all Windows 10 users as part of the upcoming Anniversary Update. Members of the Windows Insider program, as always, will get to see those improvements first in preview builds.

In a blog post, Microsoft offered a couple of examples of its JavaScript improvements. One of them concerns how Edge handles small-sized functions in scripts on websites:

To optimize for this pattern especially in terms of memory consumption, Chakra has refactored the metadata format used for each function (internally referred to as FunctionBody). Based on data, pointers in FunctionBody that point to rarely used information have been moved to a dynamic auxiliary structure and will not be instantiated and consume memory unless necessary. A good example is the asm.js related data which is not applicable for most functions. Most of the 32-bit counters in FunctionBody were also observed to hardly have values over 256, such as the variable count or object literal count within a function. Thus these counters have been replaced by a compact structure that uses a single byte for each counter and can be promoted to full 32-bit if needed. Combined with a good number of functions, these seemingly subtle optimizations can make a big difference in reducing memory overhead.


While Microsoft admits it doesn't care much for synthetic JavaScript benchmark tests, it did use two of them (Octane 2.0 and Jetstream 1.1) to show that its Chakra improvements allow Edge to lead both Google's Chrome and Mozilla's Firefox in the final results. Microsoft says that even more JavaScript improvements will be added to Edge in the summer.