VM-Resources
VM-Resources copied to clipboard
Several links, articles and blogs to understand how modern JavaScript compilers work and optimize our codes. Also includes various resources on ECMAScript and object-oriented programming.
Note: ⚠️ feel free to PR new links! It becomes quite difficult to find interesting resources.
JavaScript
Several links, articles and blogs to understand how modern JavaScript compilers work and optimize our codes. Also includes various resources on ECMAScript and object-oriented programming.
High-level resources
Different articles and tools dealing with more or less important notions:
- Setting up prototypes in V8
- What's up with monomorphism (from Vyacheslav Egorov)
- JavaScript engine fundamentals: Shapes and Inline Caches
- JavaScript engine fundamentals: optimizing prototypes
- JavaScript performance pitfalls in V8
- Wormholes in JavaScript (from Mathias Buus)
- Dr. Axel Rauschmayer Blog - Really a lot of topics that have been covered over time. Feel free to use the search bar.
- Franziska Hinkelmann: JavaScript engines - how do they even?
- A sneak peek into super optimized code in JS frameworks by Maxim Koretskyi
- The Past, Present and Future of JavaScript Engines
- Mathias B, Benedikt M - JS Engine fundamentals
Benchmark
- Dangers of cross language benchmark games
- The trap of the performance sweet spot
- Performance tuning as the art of weather forecast
- The Black Cat of Microbenchmarks
- JavaScript MicroBenchmarks (from Benedikt Meurer) - Real example of how to make a benchmark code
Vyacheslav Egorov has written many more interesting articles (I recommend you to read them all).
Tools
- JavaScript (engine) Version Updater - Very cool when you want to run your code on several implementation (for a benchmark for example).
- eshost CLI - Run ECMAScript code uniformly across any ECMAScript host
Virtual Machine, Interpreter, Compiler
Chakra Core
V8 Engine
- V8 Engine Docs - I highly recommend the documentation on: Ignition, TurboFan, Torque
- V8 Engine Blog
- Egorov V8 resources - An extension of this repo
- Understanding V8’s Bytecode
- v8-perf
- Marja Hölttä: Parsing JavaScript - better lazy than eager?
- Embedding V8 in the real world by Stanimira Vlaeva
JSCore (from the blog)
- JavaScript core Speculation
- A New Bytecode Format for JavaScriptCore
- Concurrent JavaScript: It can work!
- JSC Love ES6
- Michael Saboff — JavaScriptCore, many compilers make this engine perform
Blogs
V8 Shared documents on different performance issues
- Surface engine signals via Tracing in V8
- Fast string concatenation in Javascript
- Faster calls with arguments mismatch
- In-place field representation changes
- Faster JS to WASM Calls
- Array destructuring for multi-value returns (in light of React hooks)
- Constant field tracking for arrays
- Fast frozen & sealed elements in V8
- Compressed pointers in V8
- Fast C API in V8
- Spread call performance
- Iterator builtins design document
- Zero-cost async stack traces
Papers and academic research
- Revolutionizing Embedded Software
- Context Threading: A flexible and efficient dispatch technique for virtual machine interpreters
- Optimizing Indirect Branch Prediction Accuracy in Virtual Machine Interpreters
- Virtual Machine Showdown: Stack Versus Registers
- A Generator of Effcient Virtual Machine Interpreters
- Branch Prediction and the Performance of Interpreters - Don’t Trust Folklore
- Loop-Aware Optimizations in PyPy's Tracing JIT
- Constant propagation with conditional branches
Most of them are referenced in the V8 documents.
Language, Principles and Specifications
Grammar
Related to ECMAScript
- ECMAScript archives
- Understanding ECMAScript Spec by V8 Team
- Document prior art / common finalizer pitfalls (WeakRef)
- TC39 - Forum
Data Abstraction, Object Oriented etc
- (recommanded) How Data Abstraction changed Computing forever | Barbara Liskov
- (recommanded) Proposal for Simplified, Modern Definitions of "Object" and "Object Oriented
- (recommanded) On Understanding Data Abstraction, Revisited
- (recommanded) Programming Paradigms for Dummies: What Every Programmer Should Know
- A Self Bibliography
- Object-Oriented Programming Versus Abstract Data Types
- Data Abstraction and Hierarchy
- Object-Oriented Programming in Scheme
- A Denotational Semantics of Inheritance
- Inheritance Is Not Subtyping
- A Behavioral Notion of Subtyping
- Representing Type Information in Dynamically Typed Languages
- A theory of Objects by Martín Abadi, Luca Cardelli