Skip to content

Add a pca-metrics command#315

Open
fitzgen wants to merge 1 commit into
bytecodealliance:mainfrom
fitzgen:pca-metrics
Open

Add a pca-metrics command#315
fitzgen wants to merge 1 commit into
bytecodealliance:mainfrom
fitzgen:pca-metrics

Conversation

@fitzgen

@fitzgen fitzgen commented Jun 8, 2026

Copy link
Copy Markdown
Member

This records various static and dynamic metrics for use in principal component analysis.

Static metrics include:

  • Various entity counts: number of functions, number of instructions, number of data segments, etc...
  • Static: instruction mix: ratio of integer vs float vs memory load vs etc... instructions

There are two categories of dynamic metrics:

  1. Dynamic Wasm instruction mix: This is recorded via instrumenting the benchmark with counters for each instruction category and incrementing an instruction's associated counter as the program runs (with an optimization to batch these increments up once per basic block).

  2. Callgrind-based metrics: The benchmark is run through callgrind with a fixed cache and branch predictor simulation configuration (so the metrics are independent of the host machine's microarchitecture) and then we report the cache read/write miss ratio, branch prediction miss ratio, number of Wasm instructions executed per native instruction, etc...

@fitzgen fitzgen requested a review from posborne June 8, 2026 19:57
@fitzgen fitzgen force-pushed the pca-metrics branch 2 times, most recently from 3ab5157 to 6a023ad Compare June 8, 2026 20:08
This records various static and dynamic metrics for use in principal component
analysis.

Static metrics include:

* Various entity counts: number of functions, number of instructions, number of
  data segments, etc...
* Static: instruction mix: ratio of integer vs float vs memory load vs
  etc... instructions

There are two categories of dynamic metrics:

1. Dynamic Wasm instruction mix: This is recorded via instrumenting the
   benchmark with counters for each instruction category and incrementing an
   instruction's associated counter as the program runs (with an optimization to
   batch these increments up once per basic block).

2. Callgrind-based metrics: The benchmark is run through callgrind with a fixed
   cache and branch predictor simulation configuration (so the metrics are
   independent of the host machine's microarchitecture) and then we report the
   cache read/write miss ratio, branch prediction miss ratio, number of Wasm
   instructions executed per native instruction, etc...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant