Hasty Briefsbeta

Out-Fibbing CPython with the Plush Interpreter

18 days ago
  • #programming
  • #benchmarking
  • #optimization
  • Plush is a toy programming language with actor-based parallelism.
  • The author aims to optimize the Plush interpreter for better performance.
  • The recursive Fibonacci (fib) benchmark is used to measure performance.
  • Plush initially runs fib(38) in 9.10s, slower than Python's 5.70s.
  • Optimizations include combining push and call into call_direct, reducing time to 8.44s.
  • Using perf tool, the author identifies hash lookup overhead in function calls.
  • Introducing call_pc instruction with self-modifying code reduces time to 5.13s.
  • Adding add_i64 instruction for integer operations further reduces time to 4.57s.
  • Optimizations show no impact on a parallel raytracer program, highlighting microbenchmark limitations.