--trace-opt and --trace-deopt
V8 command-line flags that make Node.js print a line each time a function is optimised or deoptimised, with the reason.
In more detail
Run node --trace-opt --trace-deopt app.js to see them. They are V8 options rather than Node.js options, listed by node --v8-options, and their output format can change between versions.
Related terms
- deoptimization — When a just-in-time compiler throws away optimised machine code because the assumptions it was built on no longer hold, and falls back to slower code.
- TurboFan — V8's optimising compiler, which turns hot functions into fast machine code based on the types it has seen.
- command-line flag — An option typed after a program's name to change how it runs, such as --watch in node --watch server.js.
Taught in
- V8 Engine & JIT Pipeline: Bytecode & Turbofan — Node.js Internals & Backend Services