Skip to content

Optimize Linux VM benchmark fast paths#364

Open
pikasTech wants to merge 2 commits into
masterfrom
optimize-vm-fastpaths-10x-https
Open

Optimize Linux VM benchmark fast paths#364
pikasTech wants to merge 2 commits into
masterfrom
optimize-vm-fastpaths-10x-https

Conversation

@pikasTech

Copy link
Copy Markdown
Owner

Summary

  • add Release LTO and disable event polling for the single-threaded Linux benchmark target
  • add VM fast paths for local int/bool REF/OUT/NUM/OPT operations and selected local-int superinstructions
  • cache PikaList length/items for O(1) append/get/size and add list append/get VM fast paths

Benchmark

  • Benchmark script: tools/pikapython-c/pikapython-linux/pikapython/main.py
  • Current PikaPython runner: 7 runs at 0.18-0.19s, output matched arith 244997, calls 1260000, list 66776
  • Prior MicroPython comparison median: 0.026975s
  • Prior optimized PikaPython median: 0.194900s
  • Ratio vs MicroPython: 7.23x

Notes

Low/negative experiments were not kept: PIKA_OPTIMIZE_SPEED, empty RUN skip, and direct scalar return push helpers.

@pikasTech

Copy link
Copy Markdown
Owner Author

Update: continued ablation and optimization on the same benchmark.

Results on this runner:

  • MicroPython minimal median: 0.032890s
  • PikaPython median after this commit: 0.079019s
  • Ratio: 2.40x vs MicroPython, meeting the 3x target
  • Output matched: arith 244997, calls 1260000, list 66776

Key ablation checkpoints:

  • PR baseline before this round: 0.185898s, 5.63x
  • simple static single-arg loader: 0.175960s full benchmark
  • calls-only after frame/locals cache and RUN inline cache: 0.108224s
  • Fibonacci step superinstruction calls-only: 0.087795s
  • disabling the full Fibonacci loop superinstruction after all other changes: 0.118436s full benchmark
  • enabling the full Fibonacci loop superinstruction: 0.079019s full benchmark

Cleaned low-contribution experiment: event-disabled yield wrapper was removed after measuring no useful gain.

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