-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Transactions
-
Storage Engines - Transactions
-
2,863.414
-
SE Transactions - 2026-09-25, SE Transactions - 2026-11-06, SE Transactions - 2026-11-20
-
5
Problem
Many WiredTiger structures declare multiple standalone bool fields instead of packing them into a single uint32_t/uint8_t flags field, and struct field ordering across the codebase is often not size-aware. Both waste memory to alignment padding, which matters for structures allocated per-page, per-cursor, or per-session at scale (e.g. WT_BTREE, WT_SESSION_IMPL, WT_CURSOR_BTREE, WT_PAGE, WT_REF).
Goal
- Audit hot/high-count structures under src/include for groups of adjacent bool fields that can be consolidated into an existing or new flags bitmask (using the LF_SET/LF_ISSET/F_SET/F_ISSET conventions already used elsewhere in the codebase).
- Reorder remaining fields (largest-alignment-first, or otherwise grouped to minimize padding) to shrink sizeof() for these structures.
- Verify with sizeof() assertions or a one-off instrumentation pass that struct sizes actually shrink; confirm no measurable regression in access patterns (flag checks moving from direct bool reads to bitmask tests).
Notes
- Should be split into per-structure sub-tasks/PRs to keep review size manageable and bisectable if a regression appears.
- Coordinate with dist/flags.py generated flag definitions where applicable.
- Out of scope: changing on-disk formats; this is an in-memory layout optimization only.
- is related to
-
WT-19092 Add s_all checks for avoidable structure padding and boolean consolidation
-
- Backlog
-
-
WT-19094
Check whether WT_BLOCK_SYNC_ON_CHECKPOINT can be removed
-
- Closed
-
- related to
-
WT-19092 Add s_all checks for avoidable structure padding and boolean consolidation
-
- Backlog
-
-
WT-19178 59.39% increase in set_bounds_compiled_nanoseconds_90th_percentile in Variant amazon2023-perf-tests-arm64 for Task cppsuite-bounded-cursor-perf-stress-perf in Test bounded_cursor_perf
-
- Open
-
-
WT-19094
Check whether WT_BLOCK_SYNC_ON_CHECKPOINT can be removed
-
- Closed
-
-
WT-19170 3.38% increase in Read count in Variant amazon2023-perf-tests-arm64 for Task perf-test-evict-btree in Test evict-btree.wtperf
-
- Needs Verification
-