The engine that drives NodeJS. Embeddable.
Learning V8 project
V8 Dev Blog:
- Oilpan is a standalone garbage collection library for C++ hosted by the V8 project.
- WebAssembly topics:
- Up to 4GB of memory: Thanks to recent work in Chrome and Emscripten, you can now use up to 4GB of memory in WebAssembly applications. That’s up from the previous limit of 2GB.
wasm-decompile: wasm-decompile produces output that tries to look like a "very average programming language" while still staying close to the Wasm it represents.
- Emscripten and the LLVM WebAssembly backend: WebAssembly is normally compiled from a source language, which means that developers need tools to use it. Because of that, the V8 team works on relevant open-source projects like LLVM, Emscripten, Binaryen, and WABT. This post describes some of the work we’ve been doing on Emscripten and LLVM, which will soon allow Emscripten to switch to the LLVM WebAssembly backend by default — please test it and report any issues!
- Short builtin calls: we’ve realized that function calls between embedded builtins and JIT compiled code can come at a considerable performance penalty. This cost depends on the microarchitecture of the CPU. In this post we’ll explain why this is happening, what the performance looks like, and what we’re planning to do to resolve this long-term.
- Super fast property access: The super keyword can be used for accessing properties and functions on an object’s parent.
- An additional non-backtracking RegExp engine: V8 ships with a new experimental non-backtracking RegExp engine (in addition to the existing Irregexp engine) which guarantees execution in linear time with respect to the size of the subject string.
- Indicium: This system analyzer is a unified web interface to trace, debug and analyse patterns of how Inline Caches (ICs) and Maps are created and modified in real-world applications. V8 already has a tracing infrastructure for ICs and Maps which can process and analyse IC events using the IC Explorer and Map events using Map Processor. However, previous tools didn't allow us to analyze maps and ICs holistically and this is now possible with system analyzer.
- Slack tracking: Slack tracking is a way to give new objects an initial size that is larger than what they may actually use, so they can have new properties added quickly. And then, after some period of time, to magically return that unused space to the system. Neat, huh?
- Understanding the ECMAScript spec: Part 1 | Part 2 | Part 3 | Part 4
- Blazingly-fast parsing: Part 1: the scanner | Part 2: lazy parsing
- Pointer compression in V8: There is a constant battle between memory and performance. As users, we would like things to be fast as well as consume as little memory as possible. Unfortunately, usually improving performance comes at a cost of memory consumption (and vice versa).
- Improving V8 regular expressions: In its default configuration, V8 compiles regular expressions to native code upon the first execution. As part of our work on JIT-less V8, we introduced an interpreter for regular expressions. Interpreting regular expressions has the advantage of using less memory, but it comes with a performance penalty. In this blog post we describe how we take advantage of the upsides of interpreting regular expressions while mitigating the downsides.
- A lighter V8: In late 2018 we started a project called V8 Lite, aimed at dramatically reducing V8’s memory usage. Initially this project was envisioned as a separate Lite mode of V8 specifically aimed at low-memory mobile devices or embedder use-cases that care more about reduced memory usage than throughput execution speed. However, in the process of this work, we realized that many of the memory optimizations we had made for this Lite mode could be brought over to regular V8 thereby benefiting all users of V8.
(Lots more posts there, sorted by category as well: internals ECMAScript spec WebAssembly memory)
v8-android: Example Android Studio project that embeds v8 (plus some notes on compiling v8 for android)
Last modified 01 February 2022