Shopify / yjit-bench

Set of benchmarks for the YJIT CRuby JIT compiler and other Ruby implementations.
MIT License
87 stars 22 forks source link

Remove Rack::Static from rack benchmark #298

Closed casperisfine closed 6 months ago

casperisfine commented 6 months ago

It does a call to Dir.pwd which end up being 50% of the runtime. I'll see upstream if perhaps this call could be cached, and also perhaps see in RUby why it's this slow (It's a syscall, but even for a syscall it seems very slow).

After:

interp: ruby 3.3.1 (2024-04-23 revision c56cd86388) [arm64-darwin23]
yjit: ruby 3.3.1 (2024-04-23 revision c56cd86388) +YJIT [arm64-darwin23]

-----  -----------  ----------  ---------  ----------  ------------  -----------
bench  interp (ms)  stddev (%)  yjit (ms)  stddev (%)  yjit 1st itr  interp/yjit
rack   72.9         4.8         52.8       2.4         1.24          1.38       
-----  -----------  ----------  ---------  ----------  ------------  -----------
casperisfine commented 6 months ago

Hum, wait, there's something wrong. That Dir.pwd is in the rack initialize. Seems like the benchmark was wrong all along.