Skip to content

Commit dbc75bd

Browse files
Lewin671claude
andcommitted
Document the typed-loop trace on perf-counters builds
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent ff16850 commit dbc75bd

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

docs/benchmarking.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,20 @@ A counter-enabled build is a **diagnostic build and must never be used for
411411
timing** — the counters add work to the paths they observe. Nothing is
412412
compiled in without the feature: every counting site expands to nothing.
413413

414+
The same build also carries the typed-loop trace. With `QJS_TL_TRACE=1` in
415+
the environment it prints one line per region the compiler gave up on
416+
(`TLGIVEUP`, with the instruction and what the pass discovered), per region
417+
that failed or compiled (`TLFAIL`, `TLOK`), and per deoptimization at run
418+
time (`TLDEOPT`, with the site and the bytecode it resumes at). A histogram
419+
of `TLDEOPT` lines over a corpus names the shapes that deoptimize a region
420+
on every entry, which is how the array element write, `push`, and
421+
`charCodeAt` gaps were found:
422+
423+
```sh
424+
QJS_TL_TRACE=1 ./target/perf-counters/release/qjs case.js 2>&1 >/dev/null \
425+
| grep TLDEOPT | sed 's/ ip [0-9]* / /; s/ bc .*//' | sort | uniq -c | sort -rn
426+
```
427+
414428
This is what the two suites report for a nominal 100,000 iterations:
415429

416430
| Case | Suite | Claims | Real calls | Real property ops | Declined plan edges |

0 commit comments

Comments
 (0)