-
Notifications
You must be signed in to change notification settings - Fork 14
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
blocking parallel execution? #31
Comments
That sounds really weird. I'll take a look. FWIW, there are no mutexes at all in refmt -- I've intentionally kept them out, with the idea that if the application needs them, then everything can be |
I'm not a go-internals expert, but I was wondering if it was related to interfaces and reflection... and/or use of channels... but I'm not sure. |
I took your gist and ran with it a bit, and came up with this: https://gist.github.com/warpfork/ac63075a5d2996e011822423db7e2b1c I don't think the parallelism is the problem here. A reproducer with some of those more complicated objects might be worth trying to fabricate. And that's something I'd really like to merge more of also; the current benchmarks in the refmt repo are a little too narrow in what they exercise. |
Ok. Thanks for looking! Let me take my real-world app and see if I can't make a simpler repo that's not as simple as that :) |
I know this is way too complicated for a repro... but it's what I have at hand that led me down this path... maybe it's only about go context switching... but: https://github.com/QuorumControl/encodeexplore That will produce output for how long each decode took There are occasional huge spikes:
|
FWIW - switching the call to a time.Sleep(2 * time.Milisecond) does not have wild swings like that. |
Okay, I definitely have something to keep investigating there 🤔 |
I know that's not ideal code to work with and it's nested go routines... let me know how I can help. |
Hi! Love the project. Really great work.
While working with the go IPLD library. I noticed real-world slow down in my app that looked like blocking behavior... up to 200-600ms for a simple action to complete.
I eventually narrowed it down to a line in the IPLD cbornode library and then continued down the rabbit hole into refmt. ipfs/go-ipld-cbor#37
It seems like individual encoding/decoding is fast, but that somehow decoding can block other decodes. I haven't yet delved into the internals of refmt to check this out.
Here's a failing test with 160ms decodes. It has 10k parallel processes, but in my real-world app I had hundreds but more complicated objects showing the same behavior (or longer times).
https://gist.github.com/tobowers/d7a0e05d68459da54808a65c145c50d5
The text was updated successfully, but these errors were encountered: