Frontend Development 12 min read

What’s New in JavaScript: V8 Performance Boosts and New Language Features

The article summarizes the latest JavaScript enhancements presented by the V8 team at Google I/O, covering massive async performance gains, new engine components like TurboFan and Orinoco, and a suite of language features such as class fields, private members, numeric separators, bigint, extended Intl APIs, top‑level await, Promise.allSettled/any, and WeakRef, illustrated with practical code examples.

360 Tech Engineering
360 Tech Engineering
360 Tech Engineering
What’s New in JavaScript: V8 Performance Boosts and New Language Features

During the recent Google I/O, the V8 team presented a range of improvements to JavaScript execution speed and introduced several new language features. The engine now parses code twice as fast, executes async functions up to 11 times quicker, reduces memory usage by about 20 %, and adds stable sorting, top‑level await, and new Promise combinators.

Key architectural upgrades include the new TurboFan compiler, the Orinoco garbage‑collector, and a bug fix in Node.js 8 that reduced the async/await implementation from three promises to a single one, dramatically speeding up async code.

Among the language enhancements are class fields that can be initialized directly in the class body, private fields with a leading # , the String.matchAll method for repeated regex matches, numeric separators allowing underscores in numeric literals, the bigint type, and a host of new Intl APIs for localized formatting, relative time, and list handling.

Below are representative code snippets that demonstrate some of these features:

const news = [1,3,5,6,7,9,10,11]; const ads = [2,4,8,12];

To record the positions of news and ads compactly, a binary flag string can be used:

0b1011010100010001 // binary representation of positions 0b1_011_010_100_010_001 // with numeric separators for readability

Async performance improvements can be leveraged with the new Promise.any and Promise.allSettled methods:

await Promise.any(services.map(service => service.upload(file))); await Promise.allSettled(services.map(s => s.upload(file))); await Promise.any(services.map(s => s.upload(file))); await Promise.allSettled(services.map(s => s.upload(file))); await Promise.try(...); await Promise.some(...); await Promise.reduce(...);

WeakRef provides a way to hold weak references without affecting garbage‑collection counts:

function f() { var o = new WeakRef({}); var o2 = o; o.a = o2; // creates a reference cycle return "azerty"; } f();

In a multi‑process scenario, replacing a strong global reference with a WeakRef eliminates the need for explicit delete operations:

const metric = 'event'; global.DATA[metric] = new WeakRef({}); process.on(metric, () => { const ref = global.DATA[metric]; if (ref !== undefined) { return ref.deref(); } return ref; });

The article concludes by noting additional useful features such as String.matchAll and various Intl classes, encouraging developers to adopt them to improve productivity and replace older libraries like Moment.js.

PerformanceJavaScriptV8AsyncPromiseWeakRefnumeric-separator
360 Tech Engineering
Written by

360 Tech Engineering

Official tech channel of 360, building the most professional technology aggregation platform for the brand.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.