Repository navigation
perf(writer): encode on all cores, gzip in parallel, share IRIs - #11
Merged
Merged
Conversation
examples/bench_data generates deterministic CSV, XLSX, Parquet and many-small-files inputs at a chosen scale; scripts/bench.sh reports wall time, peak RSS and quads per second for each case. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Measured with scripts/bench.sh on an M3 Max, 5M-row CSV / 10M-row Parquet: - Buffer stdout: unbuffered, every quad was a write system call (CSV to stdout 39.7 s -> 1.3 s at 1% scale). - Share IRIs as Arc nodes with static predicates and one graph per batch, cache row/column nodes, and mint cell UUIDv8s from a precomputed SHA-256 prefix state. - Encode N-Quads/N-Triples on a pool of encoder threads with a direct byte encoder identical to oxrdf's Display, so one file uses every core; the writer only moves bytes. - Compress .gz on all cores into a single standard gzip member (gzp, level 6). CSV 81.7 s -> 11.5 s, CSV.gz 215 s -> 26.5 s, Parquet 141 s -> 20.8 s, XLSX 16.5 s -> 5.9 s. Output is byte-identical to the previous release (sorted N-Quads, run graph excluded); gzip output is a single member. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a reproducible benchmark and makes triplify 2.4–8× faster, with byte-identical output.
Results
scripts/bench.sh 1.0on an Apple M3 Max with 16 cores:.nq.gz--profile--profileWhat changed, in profiling order
Arcnodes, predicates are static, and the graph name is stored once per batch;fmt.Display, which oxttl uses as well, for every literal shape and every escaped character.--canonicalkeep the serializing writer.gzpcompresses on all cores into one standard gzip member at level 6, like pigz. Files are within 0.7% of the previous size.Verification
--profile. That is 5,995,229 quads at 1% scale and 56,440,051 quads gzipped at 10% scale.GzDecoder.--lib,--bins,--tests) and fmt are clean.Notes
flume(MPMC channels for sync and async producers),gzpwithdeflate_zlib(C zlib compiled viacc, no cmake), anditoa. The CI wheel matrix will confirm that they build on all six targets..nq.gzpeak memory rose to 390 MiB, from gzp's per-thread buffers plus the queue.AGENTS.mdasks for a benchmark plus the identical-output check on changes to the emit, encode or writer path.🤖 Generated with Claude Code