nesquena / rabl

General ruby templating with json, bson, xml, plist and msgpack support
http://blog.codepath.com/2011/06/27/building-a-platform-api-on-rails/
MIT License
3.64k stars 334 forks source link

Slow down of integration specs when using 7.2 defaults #769

Closed tagliala closed 15 hours ago

tagliala commented 1 week ago

Not sure this is a rabl problem

7.1 defaults

Finished in 0.000828s, 0.0000 runs/s, 0.0000 assertions/s.
0 runs, 0 assertions, 0 failures, 0 errors, 0 skips
...................................................
51 passes, 0 failures, 0 errors in 0.242657 seconds

7.2 defaults

Finished in 0.000954s, 0.0000 runs/s, 0.0000 assertions/s.
0 runs, 0 assertions, 0 failures, 0 errors, 0 skips
...................................................
51 passes, 0 failures, 0 errors in 1.828190 seconds
tagliala commented 1 week ago

It's yjit

Rails.application.config.yjit = true
tagliala commented 15 hours ago

It's a combination of Apple Silicon + x64 Ruby

tagliala commented 3 hours ago

After several tests, I came to the conclusion that it is a combination of Apple Silicon (?) + x64 Ruby + YJIT

With ARM Ruby + YJIT the difference is negligible, but x64 Ruby + YJIT is slower by several orders of magnitude

This does not seem to affect CI

Apparently this also affects Intel Macs, there could be an issue with macOS + Ruby x64 + YJIT

I've tried to upgrade rust, but there is no difference

In the end, to fix this issue on my machine, I've reinstalled Ruby x64 without YJIT

rvm reinstall ruby-3.3.6 --with-opt-dir="$(brew --prefix openssl)" --with-libyaml --disable-yjit