Repository navigation
perf: rows from one on-file block share their key strings - #1520
Merged
Merged
Conversation
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.
Fixes #1484
Rows parsed from one block of
on-fileoutput now share oneArc<str>per key instead of each row owning its own keyStrings. Before this change, the thread that inserts rows freed two small strings per row. Those strings were allocated on the parse threads, and the frees cost about 120ns per row. On the jsonl case that made the insert thread fall behindjq.Profile (4 files, 4M events; the native
jq+xargs-Ptakes about 2.0s):jqexitsjqexitsGROUP BYscan + sort)Paired wall-clock medians against
jq+xargs-Pon the same machine (load 8-37 from other agents):What remains is the query itself. At both sizes, inserting now ends when the last
jqexits, and SQLite'sGROUP BYscan and sort (about 0.1s at 1M rows) is the whole gap. Thecache_size,temp_store,threadsandmmap_sizepragmas did not move it.infer::JsonRowis public, so Rust callers that build one by hand must change their code (see the migration fragment).Red commit first:
parse_rows_shares_one_allocation_per_key_across_a_blocks_rowsfailed in CI on unequal key pointers (run 38751432473).E2E Verification
cargo test -p dirsql --features cli --libpass)packages/python/e2e-attestations/<branch>.jsonreceipt written ifpackages/pythonchanged (just e2e-attest-python)packages/ts/e2e-attestations/<branch>.jsonreceipt written ifpackages/tschanged (just e2e-attest-ts)testing-conventions e2e attest 'uv run python -m pytest tests/e2e/jsonl_parse_speed_test.py tests/e2e/frontmatter_parse_speed_test.py tests/e2e/on_file_query_test.py tests/e2e/fanout_test.py tests/e2e/declared_table_name_test.py tests/e2e/query_contract_test.py tests/e2e/use_case_transcripts_test.py -x -q -s';just e2e-attest-tsChangelog / Migrations
<root>/<pkg>/changelog.d/for each changed package (or:skip-changelogtrailer on a commit with reason)<root>/<pkg>/migrations.d/for each changed package (every subsection but Summary_None._when nothing breaks)