Skip to content

优化 VM 指令分发热路径#375

Open
pikasTech wants to merge 1 commit into
masterfrom
perf/vm-dispatch-linux
Open

优化 VM 指令分发热路径#375
pikasTech wants to merge 1 commit into
masterfrom
perf/vm-dispatch-linux

Conversation

@pikasTech

Copy link
Copy Markdown
Owner

目标

根据 Linux gprof 热点证据降低 VM 每条指令的固定分发开销,不改 VM 架构或字节码格式。

变更

  • PIKA_DEBUG_BREAK_POINT_MAX=0 时编译掉每指令断点检查。
  • 直接从当前 ins_unit 读取 invoke depth,避免重复定位当前指令。
  • 同一指令内复用一次 error-stack 检查结果,减少正常路径重复检查。

Linux 性能证据

同一 D601-VM、同一 Docker 镜像、同一 fib(20) bytecode workload;每个 profile 合并 10 个 gmon,每个进程执行 10 次:

  • v1.14.0:8.4322s、8.4624s,平均 8.4473s。
  • 候选:8.0523s、8.0339s,平均 8.0431s。
  • 平均耗时下降 4.79%,等价吞吐提升约 5.03%。
  • 分配次数均为 11,072,250,未增加分配。

资源与回归

  • 相对 v1.14.0:Flash 151676 -> 151740 B,增加 64 B(0.042%)。
  • static RAM、Pika heap peak、stack upper bound、RAM peak estimate 全部不变。
  • linux-no-lvgl Docker workflow 的 build、Linux 单测和 Google Benchmark 全部通过。
  • QEMU 仅用于功能路径和资源取证,不作为性能裁决。

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