Repository navigation
fix: collect setup garbage before timed bench samples - #152
Closed
natemoo-re wants to merge 1 commit into
Closed
natemoo-re wants to merge 1 commit into
natemoo-re wants to merge 1 commit into
Conversation
commit: |
Merging this PR will not alter performance
Comparing Footnotes
|
Member
Author
|
Closing: CodSpeed showed all 300 benchmarks unchanged (walltime included), while the forced |
This file contains hidden or 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
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.
What does this PR do?
Every walltime sample runs
setupUI()inbeforeEach. That builds a new UI and tree, and the previous fixture becomes garbage. Nothing collects it before the timed function runs, so a GC pause for setup work can land inside a sample. The pause is charged to whichever tree shape and size happens to cross the threshold.beforeEachnow callscollectGarbage()(globalThis.gc?.()) after setup.--expose-gc. Vite merges this with the flags the CodSpeed plugin adds. I checked thatgcis a function inside the bench worker with the flag andundefinedwithout it.CodSpeed's memory instrument already runs with
--expose-gcand callsgc()just before its single measured run, so this doesn't change memory results. Those peaks come from allocations inside the run (see #151). This is for walltime.Type of change
Checklist
pnpm test)pnpm format)No changeset: benchmark tooling only.
AI-generated code disclosure