Skip to content
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

Backport optimizations for graphql-core #1

Merged
merged 3 commits into from
Oct 21, 2023

Conversation

snuderl
Copy link
Contributor

@snuderl snuderl commented Aug 18, 2023

Backports a performance optimization that was done in graphql-core repository graphql-python/graphql-core@1062cbb

TLDR: Avoid using Promise.all if there is we have a single promise only

Also changes how tests are run a bit so we can execute pytest-benchmark.

Before:

-------------------------------------------------------------------------------------------- benchmark: 2 tests -------------------------------------------------------------------------------------------
Name (time in us)                   Min                   Max                Mean             StdDev              Median                IQR            Outliers  OPS (Kops/s)            Rounds  Iterations
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_executes_simple_query      87.4170 (1.0)        146.4170 (1.0)       91.3595 (1.0)       4.9577 (1.0)       90.2500 (1.0)       1.8965 (1.0)         51;66       10.9458 (1.0)         776           1
test_execute_list_results      469.0420 (5.37)     1,369.2080 (9.35)     494.5048 (5.41)     53.0961 (10.71)    482.0000 (5.34)     15.7500 (8.30)        31;59        2.0222 (0.18)        550           1
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

After:

------------------------------------------------------------------------------------------ benchmark: 2 tests ------------------------------------------------------------------------------------------
Name (time in us)                   Min                 Max                Mean             StdDev              Median               IQR            Outliers  OPS (Kops/s)            Rounds  Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_executes_simple_query      77.9170 (1.0)      176.9580 (1.0)       81.5066 (1.0)       4.9002 (1.0)       80.7500 (1.0)      1.8228 (1.0)         40;58       12.2689 (1.0)        1011           1
test_execute_list_results      440.3330 (5.65)     677.6670 (3.83)     453.9464 (5.57)     19.7447 (4.03)     449.1250 (5.56)     7.1147 (3.90)        46;85        2.2029 (0.18)        855           1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

@snuderl
Copy link
Contributor Author

snuderl commented Aug 18, 2023

@aminland @ericls

@snuderl snuderl changed the title Execute optimization Backport optimizations for graphql-core Aug 18, 2023
@ericls
Copy link
Contributor

ericls commented Aug 18, 2023

Thanks @snuderl, will take a look.

@tony
Copy link

tony commented Oct 21, 2023

@ericls Any opinion on this PR?

@ericls Thank you for the project, first saw the package mentioned here

@snuderl Thank you for the PR!

@ericls
Copy link
Contributor

ericls commented Oct 21, 2023

Sorry about the delay, taking a look now

@ericls ericls merged commit a08a7f5 into fellowapp:main Oct 21, 2023
@tony
Copy link

tony commented Oct 22, 2023

@ericls Thank you!

Fine to bump to graphql-core-promise on PyPI to 3.2.3.post2?

@tony
Copy link

tony commented Oct 22, 2023

(Up to you depending on how you want to handle version schemes, any type of bump will do!)

@ericls
Copy link
Contributor

ericls commented Oct 23, 2023

yea, oops, forgot to publish to pypi for the new version will do it soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants