Make profile-conversion snapshots more compact and meaningful#6152
Open
mstange wants to merge 2 commits into
Open
Make profile-conversion snapshots more compact and meaningful#6152mstange wants to merge 2 commits into
mstange wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6152 +/- ##
========================================
Coverage 83.50% 83.51%
========================================
Files 342 343 +1
Lines 36522 36669 +147
Branches 10224 10263 +39
========================================
+ Hits 30497 30623 +126
- Misses 5597 5618 +21
Partials 428 428 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
4d742c5 to
a0cb4dc
Compare
profile-conversion.test.ts was creating a snapshot file that was just a bunch of raw profile JSONs, with around 900 000 lines total. There's no way to catch regressions with such a test. Whenever we change the shape of the tables in the profile format, it affects so many lines that github's diff viewer will not render the diff, and you wouldn't be able to meaningfully read it anyway. For example, when I introduced the shared tables, I regressed the dhat importer (it was overwriting some tables with empty tables), and I missed the regression even though the test in theory "caught" it. This commit replaces the raw profile snapshots with profile "summary" snapshots. See the new snapshot file for examples. I think the new snapshots are definitely more readable / reviewable, but there's also quite a bit of new code to generate them. I'd be happy to cut back on the amount of detail we collect when we make these summaries, to simplify that new code. (Or maybe we can find a way to share some code with profiler-cli? Not sure.) The new snapshot file is around 500 lines, and around 160 times smaller than the old snapshot file. As a second measure of defense, this commit also adds a generic profile consistency checker function called `assertProfileIntegrity`. This would have caught the dhat regression by itself, because nativeAllocations.stack[0] = 55 would have tripped over the stack table being empty.
a0cb4dc to
fd7d04a
Compare
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.
Main | Deploy preview
profile-conversion.test.ts was creating a snapshot file that was just a bunch of raw profile JSONs, with around 900 000 lines total.
There's no way to catch regressions with such a test. Whenever we change the shape of the tables in the profile format, it affects so many lines that github's diff viewer will not render the diff, and you wouldn't be able to meaningfully read it anyway.
For example, when I introduced the shared tables, I regressed the dhat importer (it was overwriting some tables with empty tables), and I missed the regression even though the test in theory "caught" it.
This commit replaces the raw profile snapshots with profile "summary" snapshots. See the new snapshot file for examples. I think the new snapshots are definitely more readable / reviewable, but there's also quite a bit of new code to generate them. I'd be happy to cut back on the amount of detail we collect when we make these summaries, to simplify that new code.
(Or maybe we can find a way to share some code with profiler-cli? Not sure.)
The new snapshot file is around 500 lines, and around 160 times smaller than the old snapshot file.
As a second measure of defense, this commit also adds a generic profile consistency checker function called
assertProfileIntegrity. This would have caught the dhat regression by itself, because nativeAllocations.stack[0] = 55 would have tripped over the stack table being empty.