disco-quick

Crates.iodisco-quick
lib.rsdisco-quick
version0.2.0
created_at2023-10-31 05:07:33.140857+00
updated_at2025-05-21 01:12:21.79779+00
descriptionLibrary for processing the Discogs XML data dumps
homepage
repositoryhttps://github.com/sublipri/disco-quick
max_upload_size
id1019360
size113,674
(sublipri)

documentation

README

Disco Quick

Disco Quick is a library for processing the Discogs monthly data dumps via iterators of structs. It uses quick-xml's streaming API with a state machine that was decoupled from discogs-load and expanded to handle all the data in the dumps.

Example:

use disco_quick::{DiscogsReader, DiscogsReader::*};

for arg in std::env::args().skip(1) {
    match DiscogsReader::from_path(&arg) {
        Ok(Artists(artists)) => artists.take(1).for_each(|a| println!("{a:#?}")),
        Ok(Labels(labels)) => labels.take(1).for_each(|l| println!("{l:#?}")),
        Ok(Masters(masters)) => masters.take(1).for_each(|m| println!("{m:#?}")),
        Ok(Releases(releases)) => releases.take(1).for_each(|r| println!("{r:#?}")),
        Err(e) => eprintln!("Error reading {arg}: {e}"),
    };
}

Performance:

Running examples/count.rs with the 2023-10-01 dumps on a Ryzen 3900x with DDR4-3200 RAM produced the following results:

Parsed 8823813 artists in 20.476s (430914.2/s)
Parsed 2044219 labels in 03.186s (641475.25/s)
Parsed 2247215 masters in 23.626s (95113.26/s)
Parsed 16653652 releases in 12m30.206s (22198.756/s)

Peak memory usage was 5.2MB.

Commit count: 27

cargo fmt