Google JavaScript Engine Speeds JSON Parsing
Written by Kay Ewbank   
Monday, 12 August 2019

The latest update of  V8, Google's JavaScript engine, has been released in beta prior to its final release in coordination with Chrome 76 Stable in several weeks. This version, 7.6, speeds up JSON parsing and adds support for native stack walking.

V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, and implements ECMAScript and WebAssembly.

v8logo

 

The developers have overhauled the JSON parser to be much faster at scanning and parsing JSON, resulting in parsing of data served by popular web pages being handled up to 2.7 times faster. Until this release, the JSON parser was recursive and used native stack space relative to the nesting depth of the incoming JSON data, so could run out of stack for very deeply nested JSON data. This has been replaced by an iterative parser that manages its own stack and is limited only by available memory. The parser has also been reworked to be more memory-efficient.

The improvements follow other performance upgrades to JSON parsing added in the previous two point releases, 7.4 and 7.5. 7.4 improved the handling of calls with too few or too many parameters, in some cases reducing the call overhead by 60 percent.

Another improvement from 7.4 was a fix to handle large scripts in Chrome better, dealing with UTF-8 decoding and property names more appropriately to provide a combined 18 percent improvement.

With Chrome 75, V8 streams script directly from the network into their streaming parser, rather than waiting for the Chrome main thread. This change improves the performance of JavaScript parsing and reduces the number of concurrent streaming parse tasks, further reducing memory consumption.

Handling of frozen or sealed arrays has also been improved by the addition of a number of JavaScript coding patterns so frozen objects are handled better when called for indexof, includes, and a number of spread calls.

Promise handling has been improved with the addition of promise.allsettled. This provides a signal when all the input promises are either fulfilled or rejected, so settled. The developers say this is useful in cases where you don’t care about the state of the promise, you just want to know when the work is done, regardless of whether it was successful.

Native stack walking support has been added for Windows. Until now, Windows couldn't walk a call stack containing code generated by TurboFan when running on the x64 architecture. V8 can now provide Windows with the metadata it needs be able to walk these stacks on x64, and in v7.6 this is enabled by default.

v8logo

 

More Information

V8 version 7.6

V8 Website

Related Articles

Better ASync From V8 JavaScript Engine

Microsoft To Go Chromium Update: Confirmed

Chromium Team Changes Mind - We Will Have Pointer Events

Chromium Bug Tracker Now Open Source

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


IBM Opensources AI Agents For GitHub Issues
14/11/2024

IBM is launching a new set of AI software engineering agents designed to autonomously resolve GitHub issues. The agents are being made available in an open-source licensing model.



PHP 8.4 Adds Property Hooks
26/11/2024

PHP 8.4 is available with improvements including property hooks, asymmetric visibility, and an updated DOM API.


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Monday, 12 August 2019 )