Skip to content

Optimize TxData + DatabaseUpdate for fast construction#4138

Merged
Centril merged 1 commit intomasterfrom
centril/restructure-tx-data
Jan 27, 2026
Merged

Optimize TxData + DatabaseUpdate for fast construction#4138
Centril merged 1 commit intomasterfrom
centril/restructure-tx-data

Conversation

@Centril
Copy link
Contributor

@Centril Centril commented Jan 27, 2026

Description of Changes

Rework TxData to:

  • store all information for a table together in a single type TxDataTableEntry rather than having several different maps.
  • be constructed as fast as possible.
  • fit every entry within a single cache line, i.e., (TableId, TxDataTableEntry) takes up 64 bytes.
  • fit a single table entry inline to optimize for small transactions.
  • expose methods {inserts, deletes}_for_table to make DeltaTx faster.

Rework DatabaseUpdate to:

  • store a single DatabaseTableUpdate inline
  • make from_writes profit from the changes to TxData, avoiding the temporary hash map and allocating the necessary capacity from the start.

API and ABI breaking changes

None

Expected complexity level and risk

3? Fairly simple changes, but in important places.

Testing

Existing tests are changed to match the changes to TxData.

@Centril Centril changed the title Centril/restructure tx data Optimize TxData + DatabaseUpdate for fast construction Jan 27, 2026
@Centril Centril force-pushed the centri/table-reducer-name branch from 2c8cfc5 to 340667d Compare January 27, 2026 16:16
@Centril Centril requested a review from gefjon as a code owner January 27, 2026 16:16
@Centril Centril force-pushed the centril/restructure-tx-data branch from 01c7250 to 3cec6c0 Compare January 27, 2026 16:17
@Centril Centril force-pushed the centril/restructure-tx-data branch from 3cec6c0 to 0ee6796 Compare January 27, 2026 19:47
@Centril Centril changed the base branch from centri/table-reducer-name to master January 27, 2026 19:48
@Centril Centril enabled auto-merge January 27, 2026 19:48
restructure `TxData` to store everything for a table together

use `SmallHashMap` to optimize `TxData`
@Centril Centril force-pushed the centril/restructure-tx-data branch from 0ee6796 to b3c5fdc Compare January 27, 2026 19:48
@Centril Centril added this pull request to the merge queue Jan 27, 2026
Merged via the queue into master with commit 91b33a7 Jan 27, 2026
41 of 45 checks passed
@Centril Centril deleted the centril/restructure-tx-data branch January 27, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants