GithubHelp home page GithubHelp logo

disco-quick's Introduction

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 decoupled from discogs-load and significantly expanded to handle all the data in the dumps.

Example:

use disco_quick::DiscogsReader;
use std::env;

fn main() {
    for arg in env::args().skip(1) {
        let reader = match DiscogsReader::from_path(arg.as_ref()) {
            Ok(reader) => reader,
            Err(e) => {
                eprintln!("Error reading {arg}. {e}");
                continue;
            }
        };
        match reader {
            DiscogsReader::Artists(artists) => {
                for artist in artists.take(100) {
                    println!("Artist ID {} is {}", artist.id, artist);
                }
            }
            DiscogsReader::Labels(labels) => {
                for label in labels.take(100) {
                    println!("Label ID {} is {}", label.id, label);
                }
            }
            DiscogsReader::Masters(masters) => {
                for master in masters.take(100) {
                    println!("Master ID {} is {}", master.id, master);
                }
            }
            DiscogsReader::Releases(releases) => {
                for release in releases.take(100) {
                    println!("Release ID {} is {}", release.id, release);
                }
            }
        };
    }
}

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.

disco-quick's People

Contributors

sublipri avatar

Stargazers

J0J0 Todos avatar Frank Sachsenheim avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.