Giter Site home page Giter Site logo

elm-package-benchmark's Introduction

elm-package-benchmark

Benchmark different dependency resolver implementations using elm package universe.

Introduction

This repository contains a benchmark example using the elm package universe. It compares different implementations of package resolver algorithms:

  1. PubGrub Rust: pubgrub-rs
  2. PubGrub in Python: mixology
  3. MaxSum in Julia's Pkg.jl: Pkg.jl

The benchmark resolves the dependencies of every version of every package in the elm package registry.

Setup Python

Make sure Python 3.9 and Pipenv is installed. Create virtual environment:

pipenv sync

Cleanup repository

Delete temporary files:

bash clean.sh

Download elm package registry

Download all elm package metadata files into the folder registry:

pipenv run python download.py

This also saves the file graph.json which contains the whole dependency graph of all package versions. For missing packages it will be automatically assumed that they have only one version and no dependencies, so ignore the message about failed packages.

Run PubGrub Python benchmark

First check the simple examples:

pipenv run python example_simple.py
pipenv run python example.py

They should output the found solution.

Now run the benchmark (takes about 45 seconds):

pipenv run python example_full.py

This puts the result in result.json and prints how many package versions failed to resolve.

Run PubGrub Rust benchmark

Install Rust and clone repository:

git clone https://github.com/mpizenberg/elm-solve-deps.git

Copy example code:

ln -s "$PWD/test.rs" elm-solve-deps/elm-solve-deps-lib/examples/test.rs
cd elm-solve-deps/elm-solve-deps-lib

Compile:

cargo build --release --example test

Run benchmark and write result to file (takes about 4 seconds):

cargo run --release --example test > ../../result.yaml
cd -

Run Julia benchmark

Run benchmark (takes about 10 seconds):

julia --project=./julia julia/test.jl

Compare results

Python vs. Rust

Create file result_rust.json from result.yaml:

pipenv run python compare.py

Check differences:

diff result.json result_rust.json

Julia vs. Rust

pipenv run python compare_julia.py

Check differences:

diff result_rust.json result-julia-final.json

Download Julia general registry

Download:

git clone --depth=1 https://github.com/JuliaRegistries/General.git

Solve all Julia packages in the Julia General registry (takes about 50 min):

time julia --project=./julia julia/test-julia.jl

elm-package-benchmark's People

Contributors

patrsc 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.