-
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: don't handle SitePage nodes when deleting stale nodes #39161
Open
pieh
wants to merge
12
commits into
master
Choose a base branch
from
perf/dont-cleanup-sitepage-node-after-source-nodes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
gatsbot
bot
added
the
status: triage needed
Issue or pull request that need to be triaged and assigned to a reviewer
label
Nov 13, 2024
pieh
added
topic: core
Relates to Gatsby's core (e.g. page loading, reporter, state machine)
and removed
status: triage needed
Issue or pull request that need to be triaged and assigned to a reviewer
labels
Nov 13, 2024
pieh
force-pushed
the
perf/dont-cleanup-sitepage-node-after-source-nodes
branch
2 times, most recently
from
December 4, 2024 11:01
63be5c4
to
370b4b2
Compare
pieh
force-pushed
the
perf/dont-cleanup-sitepage-node-after-source-nodes
branch
from
December 4, 2024 11:32
370b4b2
to
f611677
Compare
pieh
force-pushed
the
perf/dont-cleanup-sitepage-node-after-source-nodes
branch
from
December 11, 2024 12:18
d0b1452
to
c4adf6a
Compare
pieh
commented
Dec 11, 2024
@@ -445,3 +452,99 @@ export const clearGatsbyImageSourceUrls = | |||
type: `CLEAR_GATSBY_IMAGE_SOURCE_URL`, | |||
} | |||
} | |||
|
|||
// We add a counter to node.internal for fast comparisons/intersections |
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.
the additions here were just moved from public.js
file here to make it easier to reuse
…itepage-node-after-source-nodes
…itepage-node-after-source-nodes
mrstork
approved these changes
Dec 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
SitePage
nodes because at this point in time site creation didn't run yet. This results in mass nodes deletion and subsequent mass node creation - other than being wasteful this tends to lead to increase in LMDB datastore file size increasing as managing disk size is not priority for it so it tends to allocate more and more space over time with data mutations even if "logical" data remains at similar volume. This PR mainly looks to avoid wasteful LMDB operations and thus trying to slow down LMDB filesize increases over timeonCreatePage
hook is used (either directly or by a plugin) it often result in temporarySitePage
nodes - initial page object created, then plugins in their hook implementation might change a page path or page context. This result in unnecessary lmdb operations. This PR adds intermediate stage when page is create and there is at least oneonCreatePage
hook that doesn't commit db operations immediately and instead waits foronCreatePage
hooks to finish and only commit final operation (this final operation might be no-op in case final page is the same as page from previous build which eliminates db mutations in those cases)Tests
Existing tests (especially e2e and integration) still pass
https://linear.app/netlify/issue/FRB-1388/gatsby-mdb-file-size-balloons-from-120mb-to-400mb-when-not-adding