-
Notifications
You must be signed in to change notification settings - Fork 37
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
Improve performance for I/O bound list resolvers by using parallel execution #457
Comments
Yep, i'm quite in a agreement with you, we need to be able to do it concurrently when it's necessary. |
That sounds like a reasonable approach. Should we make |
Adding a new argument to the Also, I'm agree with @garyd203, we should set it to The issue I see with this, is about default resolver (fields which doesn't implement a dedicated resolver) which will always be gathered that could impact the performance. FYI, @garyd203, we decided to allow synchronous coercion on list (for arguments/inputs and outputs) cause we noticed that in complexe queries with nested objects with list and arguments could lead to performance impact due to the creation of many async tasks a asyncio.gather creation that wasn't necessary cause most of arguments doesn't do any I/O (you can take multiple Relay edges connection with their arguments for example). |
@Maximilien-R @garyd203 I also think it should default to False. When you decorate a method which is not a resolver of a list/object, the Also @Maximilien-R I open to naming suggestion :) |
Naming suggestion instead of |
Thanks for the discussion @Maximilien-R and @abusi, it sounds like we have a good idea how to implement this feature. What's the way forward for doing the implementation work? Is it something one of you would want to do? Otherwise I expect I will have some time in the next month or 2, depending on my other commitments . |
I'll take a look at it wednesday, at least to check if its easily feasable or will need some important refactoring. However, it seems that @garyd203 and myself was favorable to set the If we resume the things to do:
In anycases, the new parameter should impact only list/object resolutions. |
@Maximilien-R Hum, I not really hard set on the default to |
This sounds good to me. Let us know how your investigation goes. I was wondering whether we want to implement both of these features now, or just one? AFAICT the first feature would solve all use cases. However, it may sometimes be inconvenient to users to update all relevant resolvers, and additionally our differing opinions on default behaviour suggest that it would be very useful to have the global |
Thanks @abusi and @Maximilien-R How does the release process work? When should I expect this to be in a release? (not rushing you, just looking to set my expectations) |
We have to update the documentation and the changelogs but I guess we could release a new version before the end of the week. What do you think @abusi? |
Yeah totaly, @Maximilien-R will you have time to edit the doc/changelog ? If not I may be able to do it. |
Hm... I'll try to do it this evening. |
@garyd203, version |
Thank you @Maximilien-R :-) |
At the moment, when an output list contains objects that themselves have an I/O bound resolver (eg. a secondary network RPC call to add more fields to the list items), then the list item resolvers are executed sequentially (see discussion yesterday, and also the original PR that introduced sequential resolution).
The concern here is that the elapsed wall-clock time to resolve the entire query is unnecessarily slow, because we have to wait for a sequence of network calls, which could potentially be executed in parallel instead. I'd like to start a discussion about how we could restore parallel execution for this scenario, whilst still addressing the concerns that led us to use sequential execution.
I am not fully aware of the issues. I am guessing they include:
As a conversation starter, here are some ideas for the type of behaviour we might want (either standalone, or potentially combined) to address the I/O bound list resolver scenario outlined above:
@resolver
-decorated async python function that needs to be executed in order to get the output value for a requested field)Can you please comment? Thanks
The text was updated successfully, but these errors were encountered: