Performance regression in d49635a71351 (#15365) (are-we-fast-yet run 00168)

未关闭
#15,453 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
20/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
rust
领域
performance

调研方向

Start with commit d49635a71351 and its PC-lookup changes for guest debugging, then reproduce using the sightglass commands to build old/new Wasmtime engines and benchmark dotnet-raytracer.wasm. Read docs/regressions.md first: instructions retired moved only +1.19% while cycles moved +2.37% and branch misses spiked, so check whether this is callgrind aliasing or a real execution slowdown. Done means the regression is gone or convincingly explained, with a rerun of the benchmark.

由索引模型根据 Issue 内容生成。

描述

awfy performance

are-we-fast-yet found 1 regression and 1 speedup in virtual cycles (callgrind) between Wasmtime 08cca2243427 and d49635a71351.

The range is the single commit d49635a71351 Guest debugging: fix PC lookups to find store-invariant (engine-code) trampolines too. (#15365), so it is blamed without bisecting. See the bisect.

A change counts when a Mann-Whitney U test finds it significant at the 0.01 level and it clears its phase's minimum relative change:

phase geomean individual
compilation 0.3% 1%
instantiation 2.5% 20%
execution 0.5% 2%
Regressions (1)
benchmark phase Δ virtual cycles virtual cycles noise Δ instructions retired instructions retired noise
dotnet-raytracer/dotnet-raytracer.wasm execution +2.37% (+2.35% to +2.39%) 0.024% -> 0.022% +1.19% 0.003% -> 0.003%
Speedups (1)
benchmark phase Δ virtual cycles virtual cycles noise Δ instructions retired instructions retired noise
hashset/benchmark.wasm execution -2.38% (-2.42% to -2.34%) 0.041% -> 0.043% +0.00% 0.007% -> 0.008%

A positive delta is a slowdown, a negative delta is a speedup.

instructions retired counts work done rather than how well it was predicted. A regression whose instructions didn't move is often Valgrind's branch predictors aliasing on a code layout change; see docs/regressions.md.

Each noise column is how far that event's own counts spread.

Other callgrind counters that changed for these benchmarks
benchmark phase counter Δ noise
dotnet-raytracer/dotnet-raytracer.wasm execution conditional-branch-misses +29.01% (+28.99% to +29.02%) 0.017% -> 0.013%
dotnet-raytracer/dotnet-raytracer.wasm execution l1-icache-misses +25.18% (+24.74% to +25.61%) 0.387% -> 0.420%
dotnet-raytracer/dotnet-raytracer.wasm execution indirect-branch-misses +23.31% (+23.30% to +23.33%) 0.014% -> 0.014%
dotnet-raytracer/dotnet-raytracer.wasm execution l1-dcache-read-misses -3.83% (-17.24% to -1.74%) 18.117% -> 3.047%
dotnet-raytracer/dotnet-raytracer.wasm execution indirect-branches +3.77% (+3.77% to +3.77%) 0.001% -> 0.002%
dotnet-raytracer/dotnet-raytracer.wasm execution data-writes +2.17% (+2.17% to +2.18%) 0.002% -> 0.002%
Commits

https://github.com/bytecodealliance/wasmtime/compare/08cca2243427ac669cf384259d545ba71a9f06d2...d49635a71351df82f3320095801848d8f128b938

Reproduce locally

On x86-64 Linux with Valgrind installed:

git clone https://github.com/bytecodealliance/sightglass
cd sightglass
git checkout 2d453335318d05cf42b6f3263aa68f0021985f10
rustc engines/wasmtime/build.rs -o build-engine
mkdir old new
REVISION=08cca2243427ac669cf384259d545ba71a9f06d2 ./build-engine old
REVISION=d49635a71351df82f3320095801848d8f128b938 ./build-engine new
cargo run --release -- benchmark --measure callgrind \
  --engine old/libengine.so --engine new/libengine.so \
  --engine-flags-common="-Cparallel-compilation=n --target x86_64-unknown-linux-gnu -Ccranelift-has-sse3 -Ccranelift-has-ssse3 -Ccranelift-has-sse41 -Ccranelift-has-sse42 -Ccranelift-has-popcnt -Ccranelift-has-avx -Ccranelift-has-avx2 -Ccranelift-has-fma -Ccranelift-has-bmi1 -Ccranelift-has-bmi2 -Ccranelift-has-lzcnt -Ccranelift-has-cmpxchg16b" \
  -- benchmarks/dotnet-raytracer/dotnet-raytracer.wasm
主要语言
Rust
星标
18.9k
派生
2k
平均合并
1 天 6 小时
30 天内合并 PR
238

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

bytecodealliance/wasmtime 的其他 Issue

查看 bytecodealliance/wasmtime 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。