Re: How does LuaJIT's trace compiler work?
Created on 2020-08-20T05:23:18.198477
- Loops are the preferred starting point for tracing.
- The start of functions can sometimes start tracing.
- "Small" inner loops may be unrolled and inlined.
- Lots of heuristics are used to determine where to begin and end traces.
- Story about how Cloudflare uses Luajit to power business logic; the tracing compiler takes apart the scripting and generates specialized traces for particular attacks so the system is continously optimized for what its doing *right now*.
- Trace compiler generates less than per-method compiler; most of the process stays as bytecode and traces are not long.