You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
New cargo-fuzz targets covering the in-memory byte-source parse entry points
(parse_record_from_bytes / parse_record_from_shared_bytes) and the three
ISO 2709 writers (write_arbitrary_records, over arbitrary records), run
nightly alongside the existing binary-MARC targets.
Changed
ProducerConsumerPipeline sends parsed records to its consumer one batch per
file chunk instead of one record at a time. Its channel_capacity argument now
counts batches (each one parsed file chunk) rather than records, and defaults
to 4; callers that set it explicitly should adjust.
Fixed
The binary writers now reject a single field whose serialized length exceeds
9999 bytes instead of emitting a corrupt directory. The ISO 2709 directory
entry stores field length in a fixed 4-digit field, so an over-long field
previously produced a malformed 13-byte entry; it now returns a WriterError
naming the offending tag. Affects the bibliographic, authority, and holdings
writers.
parse_batch_parallel (Rust and the Python extension) now returns a MarcError instead of panicking when given record boundaries whose offset + length exceeds the buffer or overflows usize. The function takes
caller-supplied boundaries; values from RecordBoundaryScanner are always in
range, so this only affects callers passing boundaries directly.
Performance
Binary ISO 2709 writing is roughly 2.8–3.2× faster: the bibliographic MarcWriter now serializes fields into reused buffers instead of allocating a
temporary Vec per field and per record, dropping per-record allocations from
~68 to ~1. Reading is modestly faster (~10%) from removing a redundant per-field
tag-string clone in Record::add_field.
Reading binary MARC is a few percent faster (~5–6% measured): the tag-keyed
field maps now hash with foldhash instead of the standard library's SipHash, dropping cryptographic-hash overhead that was unnecessary for short,
trusted MARC tags. Record output and field ordering are unchanged.
Constructing a reader from a Python bytes object no longer copies the whole
buffer up front: the reader borrows the immutable bytes and slices records
out of it, avoiding a full-dataset copy at construction for large in-memory
inputs. bytearray input is unchanged (still snapshotted to an owned buffer).