Microsoft today announced improvements in the Chakra JavaScript engine in the Microsoft Edge browser, which are slated to arrive next month in the Windows 10 Anniversary Update.
The firm says that it has been its mission with the Chakra engine to "make JavaScript faster for the real world web, and to continuously improve the experience of browsing in Microsoft Edge". Indeed, quite a few improvements are noted today.
One of the improvements is memory optimization in functions. Microsoft says that there is an abundance of small-sized functions in web scripts. This is true, as it"s a very common practice for developers to compartmentalize code for reusability.
Microsoft solves this problem by refactoring the metadata format in each function. For example, pointers that point to rarely used functions are "moved to a dynamic auxiliary structure".
According to Microsoft, most 32-bit counters rarely offer any values above 256. Because of this, most values can use only a single byte (for those that don"t understand binary, a byte is eight bits; 11111111 equals 255 in decimal).
Next up is deferred parsing of event handlers. Whenever you go to a website, almost everything you do can trigger an event. Whether you click a button, type in a textbox, hover over a link, or something else, you probably triggered an event in the JavaScript code that tells the site what to do when the event happens.
Normally, a browser would parse all of those event handlers when you load the page; however, most of those events never end up being used, making that method a waste of resources. Beginning with the Anniversary Update, Edge will now only parse the handlers that you use, in real-time.
All measures collected on 64-bit browsers running 64-bit Windows 10 Insider Preview
System Info: Dell Optiplex 7010 Intel(R) Core(TM) i5-3475S CPU @ 2.90GHz (4 cores) 4GB ram
It"s interesting to see Microsoft testing its new features on older hardware, as that"s Intel"s third generation Ivy Bridge CPU, where the latest model would be the sixth generation, Skylake.
Remember, you can always check out the code that makes this happen. Back in January, Microsoft open-sourced the Chakra JavaScript engine. You can head over to the ChakraCore repo on GitHub right here.
Source: Windows Blog