-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
long-running fiber performance loss since 1.14.0 #15214
Comments
Is this the same code you mentioned in https://forum.crystal-lang.org/t/there-is-a-way-to-optimize-this-program/6947/63?u=straight-shoota ? Please add at least references to related comments when cross-posting. |
Yes, I mention it in several places in the forum, and i consider this is a regression issue now. |
Thanks, I'm aware of your report. I didn't have the time to dig into it, yet. |
I reproduce on master (linux) and it goes away with It's harder to reproduce with tracing enabled, but printing more often eventually triggers it. At one point STDOUT would block, its |
Creating a log instance and using it instead of |
Same with a Channel & Fiber dedicated to write the report (so we can get the So definitely: the problem exhibited here is parallel writes to a shared |
To sum up: I pinpointed the issue to multiple threads trying to write to the same What I extracted from tracing is that the Then said thread has nothing left to do but other threads continue writing to the I don't know why it has an impact on the overall performance. It shouldn't have any impact on the other threads. |
This issue has been mentioned on Crystal Forum. There might be relevant details there: https://forum.crystal-lang.org/t/upcoming-release-1-15-0/7537/2 |
You can run it with:
CRYSTAL_WORKERS=16 crystal run --release -Dpreview_mt 1.cr
Following is the result when built with 1.13.2
Following is the result when built with 1.14.0
Following is the result when built with latest master 879ec12
The spent time from 13s -> 22s when run on latest master, almost 70% performance loss, it is reproducible.
The text was updated successfully, but these errors were encountered: