Repository navigation
Pari 0.4.2 alpha
Pre-releasePari 0.4.2 alpha
Pari 0.4.2 alpha makes persistent snapshot rewrites faster and cuts the time
DedupeIndex.close() takes.
Installation
python -m pip install "pari-similarity==0.4.2"
cargo add pari-core@0.4.2 pari-index@0.4.2 pari-store@0.4.2Python imports remain import pari. Keep all four public Rust crates on the
same release version. CLI archives, checksums, and the dependency SBOM are
attached to the
GitHub release with
GitHub build provenance attestations.
Faster snapshot rewrites
A persistent-index snapshot rewrite (automatic compaction, compact(), a large
sync(), and DedupeIndex(backend="local").close()) now merges the committed
generations, which already store keys and buckets in sorted order, instead of
loading every live key's band hashes and sorting every membership again.
Bucket ranges are merged on all CPU cores, and the file written is
byte-for-byte the same. Files from older releases whose generations do not
store keys in order fall back to the full rebuild.
Faster DedupeIndex.close()
DedupeIndex(backend="local").close() no longer reopens and revalidates the
file it has just rewritten. Both backends free the in-memory index on a
background thread after the final rewrite, instead of making close() wait
for it.
Measured on the dedicated 12-vCPU, 132 GiB host:
| 10M items | 0.4.1 | 0.4.2 |
|---|---|---|
| Persistent snapshot rewrite | 39.1 s | 24.9 s |
DedupeIndex(backend="local") close |
88.6 s | 18.5 s |
DedupeIndex(backend="memory") close |
17.8 s | 0.0 s |
| Persistent index reopen | 5.86 s | 5.04 s |
Ingest, peak memory, groups and query candidates are unchanged.
Rust adds compact_and_close() on PersistentIndex32 and PersistentIndex64.
It writes the same snapshot as compact() and consumes the handle without
reopening the file. pari-format adds BucketDirectory::split_keys,
range_cursor and BucketRangeCursor for reading disjoint key ranges of a
generation's buckets in parallel, and encode_bucket_segment_parts.
The file format is unchanged; files are interchangeable with 0.4.1.