Skip to content

Conversation

@Centril
Copy link
Contributor

@Centril Centril commented Jan 21, 2026

Description of Changes

This PR:

  • Does some minor readability improvements and organization to indices.
  • Adds Index::merge_from(&mut self, src: Self), which merges src into self. This will be used to speed up merging of transactions.
  • Makes Index::insert to exploit a property for improved performance in itself and in Index::merge_from.
  • Adds a trait invariant stating that no (key, ptr) occurs twice. This was always the case, but now it is a safety invariant and exploited for performance. This then is bubbled up to MutTxId and friends.

API and ABI breaking changes

None

Expected complexity level and risk

4 - This touches both Index::insert, Table, and MutTxId in terms of unsafe.

Testing

  • Debug assertions are added for the unsafety in Index::insert.
  • A new proptest merge_from_is_union is added that comprehensively exercises Index::{insert, merge_from, can_merge} together and for all index kinds and uniqueness.

@Centril Centril force-pushed the centril/index-merge-from branch from f8b2d98 to 923c9fb Compare January 21, 2026 18:45
@Centril Centril force-pushed the centril/index-merge-from branch from 923c9fb to 5b5e4f9 Compare January 21, 2026 18:47
@Centril Centril force-pushed the centril/index-merge-from branch from 4dd9b9b to 3acf683 Compare January 21, 2026 22:14
@Centril Centril requested a review from coolreader18 January 21, 2026 22:14
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.

3 participants