-
-
Notifications
You must be signed in to change notification settings - Fork 565
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
Feedback on Experimental Executor #397
Comments
I did a few queries with the experimental executor and didn't see any significant change in performance. Neither did I experience any unexpected behaviour. |
tried it, run my project tests no problems yet, dont see any noticeable performance gains but the tests says it runs a bit faster (just a bit) |
Here are my observations after I tested the new executor. I have 3 queries that are ridiculously slow and that I benchmark specifically for execution time. They are all very similar but query less and less fields (A is the biggest, C the smallest). To give you an idea of scale, the Query A generate a ~3MB JSON.
Surprisingly the new executor is becoming slower with huge queries. Also in my regular test suite, I have 46 queries that are tested. Most of them are relatively simple, usually not going deeper that 3 fields deep. Those test execute real SQL queries, so there is quite a few variable things in the timing, but still:
One of my query incorrectly relied on field evaluation order. I guess I could fix it rather easily, but seeing the mixed result of the new executor I might not do it straight away... |
My project has to stick with 0.12.6 because the environment has to stay in PHP 7.0 due to legacy dependencies. I have migrate some queries to GraphQL and recently found that one query in RESTful takes 600ms but GraphQL takes 1400ms.
I am not quite sure what caused the changes above but I am going to fork a copy make it compatible with PHP 7.0 and try again. Update I've done the PHP 7.0 port in https://github.com/zorji/graphql-php/tree/php-70
No noticeable difference. |
Thanks! |
Tried it on my project and the experimental executor caused many of my tests to fail. The reason is that some resolve functions in my generated types receive a Promise instead of the real value now. I might be able to fix this on my side but I'm not certain yet. 'resolve' => function ($value, $args, $context, ResolveInfo $info) {
return $value->getId();
},
|
I tried to change the resolver to this: 'resolve' => function ($value, $args, $context, ResolveInfo $info) {
return $value->then(
function ($value) {
return $value->getId();
},
function () {
throw new \Exception();
}
);
}, but then I receive this error
I don't think I can fix this... |
Hello, @enumag. Do you use a custom promise adapter? Could you provide a minimal reproducible code? |
Not to my knwledge. I'm using the overblog bundle but I don't think it changes the promise adapter.
Considering how complicated my setup is this could easily take days to prepare. I don't have that much time. |
Ah ok, yeah there is a custom promise adapter in one of the overblog libraries (and yes, I'm using this adapter). It's for DataLoaders: https://github.com/overblog/dataloader-php/blob/master/lib/promise-adapter/src/Adapter/WebonyxGraphQLSyncPromiseAdapter.php |
@jakubkulhan Btw. can I ask what you're using instead of the |
@enumag I used to have my own "databuffer" but it was very clumsy. Recently rewrote to dataloader-php. I have my own modifications there but in general it's the best solution out there I guess. |
@enumag I use custom buffer implementation based on |
Would either of you mind sharing your implementation? I don't really like the dataloader-php package. Configuration of dataloaders in overblog is very bad. |
The executor needs to be documented tho |
@jakubkulhan After having this issue opened for a while and other people trying it, we didn't get enough evidence that the new executor is significantly faster. I propose to move it to its own package which you'd maintain. Don't see much point to keep two executors in the core. We can add it to the suggested packages and complementary tools section. |
@vladar Ok. I'll create a new package and send a PR to remove the experimental executor. |
I tried running my benchmark again with the old and new executor, just to see if things got magically better since last time. But again I don't see a significant speed increase unfortunately. I really wish it was that simple to speed up my codebase 🤡 |
For what it's worth, i just ran Lighthouse's test suite with the experimental executor without any errors. Seems like it is at least correct. |
hi, sorry to be late with my comment on this but we're using webonyx/graphql quite intensively in a production environment (5000 requests per second) +/- 200 different types of graphql queries/mutations with the experimental executor. |
@jrots Thank you for the feedback! Can you compare the latest version with and without the experimental executor? Also, do you use |
Please post your feedback here on the new experimental executor introduced in #314
Especially interested in following questions:
The text was updated successfully, but these errors were encountered: