Change profile.shared.stackTable.prefix to prefixOffset (delta from current index)#6089
Change profile.shared.stackTable.prefix to prefixOffset (delta from current index)#6089mstange wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6089 +/- ##
==========================================
- Coverage 83.35% 83.30% -0.05%
==========================================
Files 339 339
Lines 35941 36048 +107
Branches 10058 9997 -61
==========================================
+ Hits 29957 30030 +73
- Misses 5556 5590 +34
Partials 428 428 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
372c5dd to
b581752
Compare
b581752 to
2b6a379
Compare
The `prefix` column of both `RawStackTable` and `StackTable` is now an `Int32Array`, with `-1` (instead of `null`) indicating that a stack node is a root. The wire format changes accordingly, so the processed profile version is bumped to 63 with an upgrader that converts the column on load.
2b6a379 to
c8f1a69
Compare
c8f1a69 to
74b6c2e
Compare
|
This is now ready for review. @canova, how do you feel about this? People will have to change any code that generates profiles, but I actually think the changes would be pretty straightforward and non-controversial. Also, I can fold the two versions into one if you'd prefer that, so that we don't have an intermediate version that uses |
Replace `RawStackTable.prefix` with a `prefixOffset` column. For each stack i, `prefixOffset[i] === 0` means i is a root, and `prefixOffset[i] === k` (with k > 0) means i's parent is at index i - k. All values are non-negative because the stack table is stored in topological order. The motivation is profile size: relative offsets are typically small numbers (stack depth) instead of large absolute indexes, so they compress better in the on-wire JSON. The derived `StackTable.prefix` keeps its absolute Int32Array representation for consumers that prefer that form.
74b6c2e to
610f1a9
Compare
|
When we compute the derived stack table, we turn |
Two new versions on top of #6087:
i - prefix[i]offsets for non-roots)Here's how this change impacts profile sizes and loading times on this profile: https://storage.googleapis.com/profiler-get-symbols-fixtures/large-speedometer3-profile.json.gz (with this corresponding size profile)
125 MB -> 89 MB on the compressed size! That's a 29% reduction!