🔥 Optional chaining syntax is coming to JavaScript!
This feature enables readable and concise expression of property accesses with built-in nullish checking.
@MayaLekova
explains:
V8 hits its long-awaited v8.0, now with optional chaining, nullish coalescing, faster higher-order builtins — oh and 40% less memory use thanks to pointer compression, no big deal.
h8rs gonna h8, V8ers gonna V8 🔥🔥🔥
🚀 In Chrome 64 and Node.js v10, your JavaScript apps now continue execution while the
@v8js
garbage collector scans the heap to find and mark live objects!
Free the main thread \o/
📣 V8 has native support for JavaScript code coverage. Tools like
@ChromeDevTools
and Istanbul can now access V8’s coverage information without instrumenting the code!
🚀 Chrome 66 reduces parse and compilation time for JavaScript code by 20-40% during initial load.
How? V8’s code caching now also kicks in after top-level execution!
🚀 Faster and easier-to-debug async functions and promises are coming to V8 v7.2 & Chrome 72!
@MayaLekova
and
@bmeurer
shed some light on the recent
@v8js
improvements:
👻 Recently, React core hit a scary V8 performance cliff.
Here’s a technical deep dive explaining what happened behind the scenes in V8, and how we fixed it!
🔥 Jest reduced their test runner time by 20% by switching from plain JavaScript objects to Maps where it made sense.
In general, don’t be afraid to use modern features! Focus on writing idiomatic code, and let JS engines worry about making it fast.
🔥 Emscripten is switching to the LLVM WebAssembly backend, resulting in…
➡️ much faster link times
➡️ smaller and faster code
➡️ support for all LLVM IR
➡️ new WebAssembly features
➡️ faster general updates from upstream LLVM
@kripken
explains:
Orinoco (V8’s garbage collector) evolved from a sequential stop-the-world implementation into a mostly parallel and concurrent collector with incremental fallback.
@hooraybuffer
talks trash:
🚀 V8 v6.9 includes Liftoff, a new baseline compiler for WebAssembly!
Liftoff vastly reduces start-up time of WebAssembly applications with a simple and fast code generator.
🎉 V8 v6.7 ships with BigInt support enabled by default!
BigInts are a new numeric primitive in JavaScript that can represent integers with arbitrary precision.
@mathias
walks through the functionality here:
🕚 WebAssembly SIMD will be shipped by default in Chrome 91.
We have updated our SIMD feature explainer and added new instructions for feature detection, cross-compilation of code targeted for SSE/AVX/NEON to Wasm, and usage from Rust.
⚡ The more the merrier: we've added Sparkplug - a new non-optimizing JS compiler - in V8 v9.1 to improve performance on real-world pages by 5-15%.
Let
@leszekswirski
take you on a tour:
📨 You can now import JSON directly from JavaScript. This works via a new import assertions feature - already in Chrome 91!
Learn how to use it from this feature explainer by
@dandclark1
from Microsoft:
🔥 (Byte)code caching reduces the start-up time of commonly visited websites by caching the result of JavaScript parsing + compilation.
How can JavaScript developers get the most out of
@v8js
code caching in
@ChromiumDev
?
@leszekswirski
explains:
🔥 As it turns out, NOT parsing is faster than parsing.
That’s why JavaScript engines implement a preparser which enables lazy parsing and compilation. Here’s how that works in V8:
🚀 Atomics API gains ability to asynchronously wait on shared memory locations!
In this new JavaScript feature explainer,
@marjakh
demonstrates how to use Atomics to implement a mutex with blocking and non-blocking modes.
🔥 JavaScript engines: The Good Parts™
An overview of the key fundamentals that are common to all JavaScript engines (and not just
@v8js
!) by
@bmeurer
and
@mathias
:
What’s new in V8 v6.9? Reduced memory usage through embedded built-ins, faster WebAssembly startup through Liftoff, better DataView and WeakMap performance, and much more!
🔥 JavaScript engine fundamentals: optimizing prototypes
➡️ Why do some engines have 2+ optimization tiers?
➡️ Why not just optimize everything?
➡️ How do engines speed up classes?
➡️ Bonus: One Weird Performance Trick™
by
@bmeurer
&
@mathias
Logical &&= assignment ||= feature ??= explainer 🔥
In which
@_shu
shows how to use a new ECMAScript syntax for conditional assignments.
(Experimental implementation is available in V8 v8.4 behind the --harmony-logical-assignment flag.)
In JavaScript, Map/Set/WeakSet/WeakMap all use hash tables under the hood.
@_gsathya
recently boosted their performance by improving the way V8 stores the keys in hash tables:
JavaScript gains first-class support for global substring replacement! 🔥
@mathias
explains the new String.prototype.replaceAll API:
(V8 v8.0 has an experimental implementation behind the --harmony-string-replaceall flag.)
🔍 JS arrays supported searching items for a while now via `.find` and `.findIndex` methods.
However, they always return the first match. What if you want to find the last matching item instead? Now you can with `findLast` and `findLastIndex`!
WebAssembly brings SIMD support to the Web. What is it?
@dptig
and
@tlively52
explain and demonstrate how to use it to run native code on the Web even faster! 🔥
(This feature is currently experimental and available under a flag.)
We shipped a new compiler named Maglev! It's a mid-tier "good enough, fast enough" compiler that improves our Speedometer score by some 5-6% while dropping power consumption by around 10%:
📢 Chrome 68 on Windows, Linux, Mac and ChromeOS supports SharedArrayBuffers again. Please note that Atomics.wake was renamed to Atomics.notify. More context in
The implementation of the BigInt proposal for ECMAScript is almost feature complete in latest
@v8js
. 😎
And the performance of this baseline implementation looks very promising already! 🔥
🔥 What’s new in V8 v7.8? Streaming compilation on preload, WebAssembly C API, faster object destructuring and RegExp matching, and improved startup times!
Understanding the ECMAScript spec, part 1:
In this article,
@marjakh
explains how JavaScript built-ins are specified, and how to make sense of the spec text. 🔥
JavaScript is now equipped with a new regular expression enhancement!
@MayaLekova
shows how it can be used for finding positions of matched groups.
(This feature is available starting from V8 v7.9 behind a --harmony-regexp-match-indices flag.)
🔥 One of the most underrated ES2019 features is “subsume JSON”, a.k.a. “JSON ⊂ ECMAScript”. It simplifies the language & enables interesting meta-programming use cases.
JSON.stringify output can now be embedded as a literal within JavaScript programs!
WebAssembly code caching is a new optimization in Chrome and V8 that tries to avoid code compilation by caching the native code produced by the compiler.
@BillB
walks through the implementation and gives a few tips for WebAssembly developers:
WebAssembly now has direct support for GC! Read our new technical article to learn about how it works as well as what the team has been doing in this space both in V8 and in the toolchain:
🔥 DataViews are now as efficient as TypedArrays in
@v8js
v6.9, finally making DataViews a viable choice in performance-critical situations.
Here’s how we boosted DataView performance:
⌚ Who's got the time to pass all the arguments to the function?
We thought so too. V8 can now invoke functions with argument number mismatch even faster! 🚅
Learn how from a deep dive by Victor Gomes:
The
@v8js
and
@ChakraCore
teams share their secret to making sure your JavaScript runs fast in every browser:
Spoiler: focus on writing idiomatic, readable, and maintainable code.
👻 A year with Spectre: a V8 perspective
In which the V8 team details their analysis and mitigation strategy for Spectre, one of the top computer security issues of 2018.
🚀 The Chrome team welcomes Speedometer 2.0!
gives an overview of the performance improvements we’ve made so far in Blink and V8 based on the new version of the Speedometer benchmark.
🔥 What’s new in V8 v7.7? Lazy feedback allocation, faster WebAssembly background compilation, stack trace improvements, and new Intl.NumberFormat functionality!
🔥 You can now use up to 4GB of memory in WebAssembly applications - and beyond!
Andreas Haas, Jakob Kummerow and Alon Zakai explain the work that went into Chrome (V8) and Emscripten to make this happen:
Iterator helpers are a collection of new methods on Iterator prototype that help in general use of iterators.
V8 shipped these helpers in v12.2! Please check out for more information.
WasmBoy is a Game Boy Emulation Library for running ROMs in browsers and in Node.js, written in AssemblyScript.
In this presentation,
@torch2424
explains why WebAssembly’s predictable performance is the perfect fit for WasmBoy:
🎓 In this Chrome University talk,
@_gsathya
and
@JakobKummerow
explain how scripts are executed in
@ChromiumDev
.
Learn how
@v8js
handles parsing, bytecode generation, interpretation, JIT compilation, and deoptimization:
🎯 Ever wanted to easily access items from the end of a collection? Well now you can!
Check out the feature explainer for the new `.at()` method on arrays, strings and TypedArrays:
🎀 We may have been quiet on the V8 blog, but it's been a busy year for the V8 team! WasmGC, security work, two(!) new compilers, new JS and Wasm features, and even some V8-adjacent Chromium optimisations — with a 34% Speedometer score improvement overall:
Emscripten now supports a standalone mode, to better serve the various ways WebAssembly is being used outside of the Web. It enables building and using Wasm modules even in runtimes without JavaScript support.
💭 WebAssembly has support for 64-bit integers. But how can it communicate with JavaScript which traditionally couldn't even represent values this large?
Learn from a new feature explainer by
@kripken
:
Let's [not] keep you in the dark anymore... Introducing dark mode for !
By default we're going to display the blog according to your system theme, but feel free to override the preference using a toggle in the footer. (h/t
@tomayac
)