#pavexc #json #rustdoc-json #json-file #output #fields #parse-json

pavexc_rustdoc_types

The slimmed down schema used by pavexc to work with rustdoc's JSON output

23 releases

new 0.1.74 Feb 12, 2025
0.1.73 Feb 11, 2025
0.1.70 Jan 24, 2025
0.1.66 Dec 31, 2024
0.1.58 Nov 29, 2024

#306 in Database interfaces

Download history 189/week @ 2024-11-05 33/week @ 2024-11-12 13/week @ 2024-11-19 778/week @ 2024-11-26 55/week @ 2024-12-03 424/week @ 2024-12-10 133/week @ 2024-12-17 81/week @ 2024-12-24 550/week @ 2024-12-31 40/week @ 2025-01-07 2/week @ 2025-01-14 246/week @ 2025-01-21 132/week @ 2025-01-28 148/week @ 2025-02-04 297/week @ 2025-02-11

823 downloads per month
Used in 2 crates (via pavexc)

Apache-2.0

49KB
456 lines

pavexc_rustdoc_types

It's a fork of rustdoc_types with a specific purpose: maximise performance when working with JSON docs in pavexc.
In particular, we want to minimise the size of the JSON files stored in pavexc SQLite database as well as the time it takes to parse the JSON files returned by rustdoc.

Changes

The changes are rather minimal: we comment out some fields that are not used in pavexc but account for a significant portion of the JSON file size. They are all marked out with a // EXCLUDED! comment.

We rely on this script:

total_size=$(wc -c < file.json); docs_size=$(jq '.. | .field_name1? // .field_name2? // empty' file.json | wc -c); echo "scale=2; $docs
_size*100/$total_size" | bc

to measure the impact of removing field_name1 and field_name2 from the JSON file. The script calculates the percentage of the JSON file size that is taken up by field_name1 and field_name2.

We strive to remove fields that account for a non-negligible portion of the JSON file size, to minimise the overhead of syncing the fork with the upstream repository.

Dependencies

~0.3–0.9MB
~20K SLoC