Skip to content

Implement HybridMap - #47

Merged
rracariu merged 1 commit into
masterfrom
feat/expose-hybrid-map
Sep 8, 2026
Merged

Implement HybridMap#47
rracariu merged 1 commit into
masterfrom
feat/expose-hybrid-map

Conversation

@rracariu

@rracariu rracariu commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Useful for 3rd party crates extending the Dict type.

  • Introduced HybridMap which uses a sorted Vec for small maps and promotes to a heavier ordered map (default: BTreeMap) when exceeding a configurable threshold.
  • Added TreeMap trait to define the required methods for the heavy backing map.
  • Implemented FromIterator and From traits for HybridMap to facilitate construction from iterators and other map types.
  • Included custom SortedVecMap as an alternative TreeMap implementation for testing.
  • Added comprehensive tests to validate the functionality of HybridMap, including insertion, retrieval, removal, and threshold behavior.

…tore

- Introduced `HybridMap` which uses a sorted `Vec` for small maps and promotes to a heavier ordered map (default: `BTreeMap`) when exceeding a configurable threshold.
- Added `TreeMap` trait to define the required methods for the heavy backing map.
- Implemented `FromIterator` and `From` traits for `HybridMap` to facilitate construction from iterators and other map types.
- Included custom `SortedVecMap` as an alternative `TreeMap` implementation for testing.
- Added comprehensive tests to validate the functionality of `HybridMap`, including insertion, retrieval, removal, and threshold behavior.
@rracariu rracariu self-assigned this Sep 7, 2026
@rracariu
rracariu requested a review from garethj2 September 7, 2026 15:26
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Coverage after merging feat/expose-hybrid-map into master will be

82.55%

Coverage Report for Changed Files
FileStmtsBranchesFuncsLinesUncovered Lines
src/haystack/val
   dict.rs92.46%100%92.80%92.39%236–238, 316–318, 325–327, 404–406, 408–410, 412–414, 515–517, 533, 540–542, 661, 694
   hybrid_map.rs87.22%100%85.11%87.67%132–135, 137–138, 288, 312, 47, 470–472, 48–49, 581, 596–599, 601, 606, 620, 629–631, 638–640, 741–743, 747, 755–757, 759, 761, 763–765, 778–781, 783–785, 787, 804–806

@rracariu
rracariu merged commit c2cef85 into master Sep 8, 2026
10 checks passed
@rracariu
rracariu deleted the feat/expose-hybrid-map branch September 8, 2026 05:51
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