-
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
[v2] Hulksmash build slowdowns on larger sites #6226
Merged
Merged
Changes from 10 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
ac4a874
Hulksmash slowdowns on larger sites
KyleAMathews cb33713
Switch more existsSync to use caching version
KyleAMathews 253e353
Convert node reducer to use Map
KyleAMathews 84c516a
Fix most lint errors
KyleAMathews b647bb1
Merge branch 'master' into speed-large-site
KyleAMathews 266f5ae
Split writing page data json files into 999 folders to speed writes
KyleAMathews 110b99e
Use forEach instead of reduce when prepping page data
KyleAMathews 710d9d8
Profiled code and fixed hot functions
KyleAMathews b039a64
Merge remote-tracking branch 'origin/master' into speed-large-site
KyleAMathews 6a8e9a0
WIP commit to dramatically speed up graphql queries
KyleAMathews 044e7b6
Handle picking directory to write StaticQuery results
KyleAMathews f231e08
Speed up resolving queries when the query is querying a node by id
KyleAMathews 0c43b29
Show pages rendered / second while building HTML
KyleAMathews 109d691
Add sites for benchmarking
KyleAMathews 272e6b0
Persist activity status at end and show queries/second for graphql
KyleAMathews 19f6c3b
Restore creating SitePage nodes as no longer slow
KyleAMathews a46c207
Correct storing/using/deleting nodes
KyleAMathews fe4125b
Disable profiling
KyleAMathews d3a95a0
Remove extra dependencies
KyleAMathews d6eefc5
Format + fix linting
KyleAMathews b729410
remove console.log and unused profile
KyleAMathews 34db11f
Remove another profile
KyleAMathews daf690f
Fix tests (hopefully)
KyleAMathews db319af
Merge remote-tracking branch 'origin/master' into speed-large-site
KyleAMathews d3acb9e
Check if nodes exists, sometimes a test fails otherwise
KyleAMathews 145a34b
debugging...
KyleAMathews c85d41e
Work around...
KyleAMathews 2cb28c7
Don't need to run bootstrap on tests as jest compiles code
KyleAMathews b7ebd8e
Lodash uses Object.entries which fails on node 6... :-"
KyleAMathews a4a1391
Ok, do need bootstrap to link packages
KyleAMathews aa47043
Try try again
KyleAMathews fa32e5d
Ugh, problem was Object.entries isn't in Node 6
KyleAMathews File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
You should be able to gain some more speed using reduce:
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.
Why would reducing be faster than filtering?
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.
You get to avoid using map to iterate through the generated array from the filter. With reduce you generate the end result in a single iteration.
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.
Hmm yeah. Generally there'll only a handful of pages w/
matchPath
so making the change should make a negligible difference 🤷♂️That being said, if you'd like to make the PR, happy to take it! Thanks for reading through the PR!