-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sidekiq is slow on TruffleRuby #1584
Comments
I don't think it matters whether or not this is run in a Rails app. EDIT: I don't have the numbers ready to copypaste, but for me, Truffle native completed the benchmark in about a minute, and MRI was about 40 seconds. |
I was running this today and here's what I found: I did run with I saw these values: TruffleRuby native With TruffleRuby I saw some delay in startup ( ~10-15 seconds of requiring/loading) which is an area I have been working on improving recently. |
latest results are Truffleruby head (23 sec) vs MRI Ruby 2.7 (23 sec) |
On par is progress (thanks for rerunning!), but I think TruffleRuby should be faster here, especially if it's allowed to process jobs in parallel. |
New numbers from @mperham: https://twitter.com/eregontp/status/1479534410546483201 |
Thanks. I appreciate you investigating this. |
I tried running the benchmark but quickly run into non-fatal errors which happen regularly. There is also another type of error when running on TruffleRuby:
This might be a bug in hiredis to not handle EINTR correctly (EINTR should always be retried). |
FYI, in my recent tests not using hiredis improves a bit overall performance. Not sure if using it brings any benefits to Redis on Truffleruby |
I see different numbers now: 45s vs 21s . Still much slower but difference is not x4 anymore, which is good |
Right, we should look at this again. I was focused on Ruby 3 keyword arguments and other things but that's done now, and the fix has been merged in sidekiq (sidekiq/sidekiq@1efbadd). Actually on master sidekiqload now doesn't use hiredis, so I think we should start with that, hiredis likely only adds complexity. |
I've been taking a look at this./ TruffleRUby is faster at the JSON generation required for creating jobs,. but it's slower at IO for a variety of reasons. The JSON generation could likely be made faster by optimising |
We also appear to be much slower at parsing the job json, so validating the job by dumping it to json and parsing it back is not working so well on TruffleRuby. |
From @nateberkopec https://twitter.com/nateberkopec/status/1096880039491133441
Instructions to reproduce at https://gist.github.com/nateberkopec/a612498e9719af6b8775ecdcb8afaa18 (time to process 20 000 empty jobs with Sidekiq).
We should investigate why it's slow.
hiredis
does not work yet (#1546).@nateberkopec Does it matter whether the benchmark is run with the Rails app, or just running Sidekiq after the script created the jobs is enough? That would simplify the setup.
The text was updated successfully, but these errors were encountered: