benchie
A tool for automating benchmarks of programming assignments.
- Github repository: https://github.com/berombau/benchie/
- Documentation https://berombau.github.io/benchie/
Installation
Install uv.
You can run the tool without installation using the following command:
uvx benchie --help
To install the tool in an environment, you can run:
uv venv
uv pip install benchie
Current support
Fetching assignments works for Dodona and subgit submissions.
Currently supported benchmarking:
- execution time (hyperfine with or without a Docker container)
- peak memory usage (memray)
- (with_imports) uses
python -m memrayand includes the memory usage of the imports - (with_tracker) uses a median of 3 executions with
memray.Tracker, which would not show the memory usage of the imports
- (with_imports) uses
Planned support
- Docker support for memray
- Support for GitHub Classroom
Run as a student
Example data
With the example data in this repository at solutions/ and data/ you can run the following command:
benchie run -S -e "example_sleep" -b hyperfine -b memray_tracker
The output will be stored in output/example_sleep/.
Run within a Docker container
First build and tag a local image with a specific name. Here we use the Dockerfile in the repository root:
docker build -t local_combio_project .
Then we can run a container from this image with the following command:
benchie run -S -e "example_sleep" -b hyperfine --docker_image local_combio_project
Memray is currently not yet supported in Docker containers.
Custom data
Put different implementations at solutions/{exercise_1}/{implementation_1}.py. Note that it's best to use double quotes '""' instead of single quotes "''" because of some current string parsing limitations.
Run the benchmark with disabled fetching of Dodona submissions and only the first 3 datasets:
benchie run -S -e "{exercise_1}" --subset_data 3
Output will be stored in output/{exercise_1}.
Run as a teacher
Fetch token from Dodona user profile and store as token file.
Setup recurrent job
- Use deploy keys
- Use git instead of https as git origin remote URL
- setup cron job
- copy conda init lines from ~/.bashrc to ~/.bashrc_conda
Use crontab -e to add a cron job (edit the repo path):
SHELL=/bin/bash
BASH_ENV=~/.bashrc_conda
0 * * * * conda activate combio_benchmark_2024; timeout --signal=KILL 1h benchie run -e "global_alignment" -fC >> ~/combio_benchmark_job.log 2>&1
Repository initiated with fpgmaas/cookiecutter-uv.
Metadata
Release files for benchie 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| benchie-0.0.3.tar.gz | 16.3 kB | Without provenance | Details for benchie-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| benchie-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for benchie-0.0.3-py3-none-any.whl |
Total release size: 33.4 kB
Release files / benchie-0.0.3.tar.gz
| Download URL | benchie-0.0.3.tar.gz |
|---|---|
| Size | 16.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
343641aab6eb85a4318527b84c11766b4f61f3c11296d5b7c4466506052a9c07
|
|
BLAKE2b-256 checksum How to use checksums |
deeebb5908a32c3f000a498b1d6713a819e613f6af2d6e8ef660192f28727423
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / benchie-0.0.3-py3-none-any.whl
| Download URL | benchie-0.0.3-py3-none-any.whl |
|---|---|
| Size | 17.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9ffc9f1fa2989c3d4ec90b9928b9e328201f835a48902d626401fd627f640101
|
|
BLAKE2b-256 checksum How to use checksums |
14b2a624b75559095f683e9e3b53d81905ab3668faa9c6fa81c9b8bb6c802813
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Security for benchie 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.