-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
perf(gatsby): use fastq instead of better-queue + refactor #31269
Conversation
Good deleted/added code ratio 👍 Looks like a ~12% speedup for 1000 queries (using my handy one-liner — I got 20% but that was with 100k queries — the more queries the bigger the speedup I'd assume given better-queue's sorting logic would get slower on bigger datasets. |
Yeah, also benchmark setup is probably different. I believe my benchmark still does a pass of fast filters (since I am not filtering by the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome results. LGTM
* master: (45 commits) chore(release): Publish next pre-minor fix(gatsby-source-shopify): fix linting (gatsbyjs#31291) fix(deps): update minor and patch for gatsby-plugin-preact (gatsbyjs#31169) chore: add gatsby-plugin-gatsby-cloud to renovate chore: update renovatebot config to support more packages (gatsbyjs#31289) chore(deps): update dependency @types/semver to ^7.3.5 (gatsbyjs#31148) fix(deps): update minor and patch for gatsby-plugin-manifest (gatsbyjs#31160) fix(deps): update minor and patch for gatsby-remark-copy-linked-files (gatsbyjs#31163) fix(deps): update dependency mini-css-extract-plugin to v1.6.0 (gatsbyjs#31158) chore(deps): update dependency @testing-library/react to ^11.2.6 (gatsbyjs#31168) docs(gatsby-source-shopify): Updates Shopify README with new plugin info (gatsbyjs#31287) chore: run yarn deduplicate (gatsbyjs#31285) docs(gatsby-plugin-image): Add docs for customizing default options (gatsbyjs#30344) fix(gatsby-plugin-image): print error details (gatsbyjs#30417) chore(docs): Update "Adding Search with Algolia" guide (gatsbyjs#29460) chore(docs): Update MDX frontmatter for programmatic pages (gatsbyjs#29798) docs: Add image plugin architecture doc (gatsbyjs#31096) perf(gatsby): use fastq instead of better-queue + refactor (gatsbyjs#31269) feat(gatsby-plugin-image): Export ImageDataLike type (gatsbyjs#30590) fix(gatsby): update plugin api types (gatsbyjs#30819) ...
* perf(gatsby): refactor query queueing and use fastq instead of better-queue * restore graphql-runner * remove "better-queue" dependency
Description
This PR is a polished version of this commit: 78d6986
Original comment from @KyleAMathews:
One major benefit of
better-queue
was support for assigning priority to tasks. We used it indevelop
to run the currently active query first. But after "query on demand" this is no longer needed as we run only active queries anyway.Benchmarks
Benchmarks with query-filter-sort site:
Before:
After:
Interestingly version of
fastq
with promises is slower (has basically the same numbers as current version)