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

perf(gatsby): Optimise distinct queries #30457

Merged
merged 1 commit into from
Mar 25, 2021
Merged

Conversation

ascorbic
Copy link
Contributor

Instead of using reduce and concat, use forEach and a Set. For a query on 30k items, this reduced the query time from around 10s to under 1s

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 25, 2021
@sidharthachatterjee sidharthachatterjee removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 25, 2021
Copy link
Contributor

@sidharthachatterjee sidharthachatterjee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! Thank you!

@sidharthachatterjee sidharthachatterjee added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Mar 25, 2021
@ascorbic ascorbic merged commit f462e23 into master Mar 25, 2021
@ascorbic ascorbic deleted the fix/faster-distinct branch March 25, 2021 14:28
@KyleAMathews
Copy link
Contributor

Woah ♥️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants