github GitoxideLabs/gitoxide gix-note-v0.2.0
gix-note v0.2.0

7 hours ago

New Features

  • batch staged note edits into a single tree write

    Creating many notes with repeated State::replace() calls serializes all
    materialized mappings after every edit. Add State::edit() to update
    retained state and State::write() to serialize once. Lookups observe
    pending edits, while immediate replacement and removal continue to flush.
    Failed writes recover the last saved root.

    Regression coverage checks zero writes during staging, cached reads,
    persisted replacements and removals, non-note preservation, no-op flushes,
    and recovery after failed writes.

Bug Fixes

  • edit notes trees lazily

    replace() and remove() loaded every fanout subtree into a HashMap, then
    reconstructed every logical note path. This made one edit O(total notes).

    Represent unopened fanout directories as radix-tree leaves carrying their
    existing tree IDs. Materialize only the matching edit path and subtrees that the
    fanout heuristic must collapse. Preserve opaque subtrees whenever the current
    fanout allows it, matching Git's trade-off: fanout after an edit depends on what
    the lazy trie has materialized instead of a global recount.

    Retain each opened subtree's original path components so non-note entries keep
    their spelling, including uppercase fanout-like directories. A regression with
    32 root fanout entries proves replacement reads and writes only the root and
    target subtree, while the Git-produced boundary fixture verifies exact tree IDs.
    The now-unused gix-hashtable dependency is removed.

    Add an in-memory Criterion benchmark for get() and replace() on 65,536-note
    trees. It covers worst-case one-to-two-level fanout expansion and common
    steady-state replacement, excludes fixture construction and filesystem I/O, and
    reports notes per second for GET and PUT. Run it with cargo bench -p gix-note --bench read-write.

    Git baseline: git.git 1630431f326e15fcde608827b5ff38422528eb59,
    especially note_tree_search(), load_subtree(), determine_fanout(),
    for_each_note_helper(), and write_notes_tree() in notes.c.

Changed (BREAKING)

  • raise MSRV to Rust 1.88

    The newly published dua-core 3.3 release used by linked-worktree removal
    requires Rust 1.88, so raise every workspace crate and the advertised badge
    together.

    Keep the MSRV checks buildable by selecting the latest sysinfo and rusqlite
    release lines that support Rust 1.88.

New Features (BREAKING)

  • require caller-owned notes-tree state
    Git keeps struct notes_tree alive across lookups and edits, preserving radix
    nodes and lazily materialized subtree entries. Recreating that structure for
    every operation repeats tree parsing and entry allocation.

    Add caller-owned State and require it in get(), replace(), and remove().
    The state advances after each successful edit. gix::note::Platform retains
    states by root-tree ID so references and aliases sharing a tree also share
    parsed entries, and clears cached states after plumbing errors.

    A counting in-memory ODB regression proves repeated operations do not reread
    materialized trees. Measurements on 65,536-note fixtures were:

    Scenario New state Reused state
    Common two-level GET ~16,700 GET/s ~111,000,000 GET/s
    Common two-level PUT ~5,470 PUT/s ~8,000 PUT/s
    One-level fanout GET ~20,100 GET/s ~108,000,000 GET/s
    One-level fanout PUT ~3,310 PUT/s ~3,980 PUT/s

    The reused one-level PUT is primed by one untimed expanding write and therefore
    measures blob-only replacements after expansion.

Commit Statistics

  • 12 commits contributed to the release over the course of 31 calendar days.
  • 32 days passed between releases.
  • 4 commits were understood as conventional.
  • 0 issues like '(#ID)' were seen in commit messages

Commit Details

view details
  • Uncategorized
    • Merge pull request #2847 from GitoxideLabs/gix-error-completion (6356013)
    • Use borrowed error inspection throughout the workspace (daf73b5)
    • Merge pull request #3004 from GitoxideLabs/gix-notes-example (a5e8c4d)
    • Batch staged note edits into a single tree write (dfa5173)
    • Merge pull request #2963 from GitoxideLabs/gix-notes-perf (4a870be)
    • Require caller-owned notes-tree state (0418bf8)
    • Edit notes trees lazily (190593f)
    • Merge pull request #2949 from GitoxideLabs/error-conversion-review (a095334)
    • Raise MSRV to Rust 1.88 (4b42e0c)
    • Merge pull request #2955 from GitoxideLabs/transport-url-encoding (7e35849)
    • Release gix-path v0.12.6, gix-error v0.3.2, gix-command v0.10.1, gix-transport v0.59.2 (888677a)
    • Merge pull request #2940 from GitoxideLabs/vendor-bisync (dda600d)

Don't miss a new gitoxide release

NewReleases is sending notifications on new releases.