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-source-contentful): fix unguided search in expensive loop #28375

Merged
merged 1 commit into from
Nov 30, 2020

Conversation

pvdz
Copy link
Contributor

@pvdz pvdz commented Nov 30, 2020

The part first builds up a set of existing names and then loops through the received data to find new data.

A site I was testing with had n at 80k elements. So this was doing an unguided search through 80k elements for 80k times.

This little fix literally drops this 5 minute step in incremental builds (and perhaps others) for that case, down to be sub-second.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Nov 30, 2020
@pvdz pvdz added topic: source-contentful Related to Gatsby's integration with Contentful topic: performance Related to runtime & build performance topic: scaling builds and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Nov 30, 2020
Copy link
Contributor

@wardpeet wardpeet left a comment

Choose a reason for hiding this comment

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

🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

@pvdz pvdz merged commit d9904ac into master Nov 30, 2020
@delete-merged-branch delete-merged-branch bot deleted the unguided_search branch November 30, 2020 15:31
@KyleAMathews
Copy link
Contributor

Wow! 🎉

pieh pushed a commit that referenced this pull request Dec 1, 2020
pieh pushed a commit that referenced this pull request Dec 1, 2020
…e lists (#28375) (#28404)

(cherry picked from commit d9904ac)

Co-authored-by: Peter van der Zee <209817+pvdz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: performance Related to runtime & build performance topic: source-contentful Related to Gatsby's integration with Contentful
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants