perf(cubeorchestrator): Improve compact transform (-75%, 3.7x-4x)#10830
Conversation
The compact transform was the only output path still doing dictionary lookups per cell, per row: for every member it re-walked annotation -> members_to_alias_map -> columns_pos before reading the cell. The other two paths (vanilla, columnar) already precompute a plan. Bench on my Apple M3 Max `TransformedData::transform/compact`, lower = faster: | cols / rows | 1 000 | 10 000 | 50 000 | 100 000 | | --- | --- | --- | --- | --- | | 8 | -73.4% | -73.6% | -72.9% | -72.9% | | 16 | -74.3% | -74.0% | -73.4% | -72.9% | | 32 | -74.5% | -73.9% | -73.2% | -72.3% | | 64 | -75.1% | -74.1% | -73.3% | -74.6% | Roughly 3.7-4.0x faster across the matrix. Same magnitude as the analogous hoist on the columnar branch (3849b71f7e).
|
Claude finished @ovr's task in 1m 39s —— View job Code Review: perf(cubeorchestrator) Compact transform plan hoisting
Overall: This is a clean, well-structured optimization. Approve. The approach is sound — it mirrors the plan-then-execute pattern already established by What changed
Correctness
Minor observations (non-blocking)
TestingThe four existing compact-row tests are correctly adapted to the two-step pattern. Test coverage is adequate for the refactor — each query type variant ( SummaryStraightforward plan-hoisting optimization that brings the compact path in line with the vanilla and columnar paths. The ~70% speedup is consistent with removing 3-4 hash lookups per cell. No correctness issues found. LGTM. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10830 +/- ##
==========================================
- Coverage 78.83% 78.82% -0.01%
==========================================
Files 470 470
Lines 92289 92289
Branches 3436 3436
==========================================
- Hits 72752 72747 -5
- Misses 19034 19039 +5
Partials 503 503
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The compact transform was the only output path still doing dictionary lookups per cell, per row: for every member it re-walked annotation -> members_to_alias_map -> columns_pos before reading the cell. The other two paths (vanilla, columnar) already precompute a plan.
Bench on my Apple M3 Max
TransformedData::transform/compact, median wall time before → after (ms):Roughly 3.7-4.0x faster across the matrix. Same magnitude as the analogous hoist on the columnar branch (3849b71f7e).