Crates.io | factorio-belt |
lib.rs | factorio-belt |
version | 1.12.1 |
created_at | 2025-06-27 23:07:40.042106+00 |
updated_at | 2025-07-26 22:16:39.92124+00 |
description | A fast, cross-platform Factorio benchmarking tool |
homepage | https://github.com/florishafkenscheid/belt |
repository | https://github.com/florishafkenscheid/belt |
max_upload_size | |
id | 1729367 |
size | 167,295 |
[!CAUTION] This project has been moved to the crate
belt
. This crate will no longer be updated.
[!NOTE] This was heavily inspired by abucnasty's work. I wanted to make a more universal, cross-platform version of the existing ps1 script.
BELT is a wrapper for the factorio --benchmark
command, to make it more user friendly, more efficient to use, and to generate templated markdown files with the gotten data.
# Install BELT
cargo install factorio-belt
# Run benchmarks on all saves in a directory
belt benchmark ./saves --ticks 6000 --runs 5
# Filter saves by pattern and customize output directory
belt benchmark ./saves --pattern "inserter*" --output ./benchmark-results
--factorio-path
.cargo install factorio-belt
git clone https://github.com/florishafkenscheid/belt.git
cd belt
cargo install --path .
# Basic benchmark with default settings
belt benchmark /path/to/saves
# Customize benchmark parameters
belt benchmark /path/to/saves --ticks 12000 --runs 10
# Filter saves and specify output location
belt benchmark /path/to/saves --pattern "benchmark" --output /path/to/output/dir
belt benchmark
Arguments:
<SAVES_DIR>
- The location of the save(s) to be benchmarked.Options:
Option | Description | Default |
---|---|---|
--ticks <TICKS> |
How many ticks per run to run the benchmark for | 6000 |
--runs <RUNS> |
How many runs per save file | 5 |
--pattern <PATTERN> |
A pattern to match against when searching for save files in <SAVES_DIR> |
* |
--output <OUTPUT_DIR> |
A directory to output the .csv and .md files to | . |
--mods-dir <MODS_DIR> |
A directory containing mods to be used for the benchmark | --sync-mods on each save file |
--run-order <RUN_ORDER> |
In which order to run the benchmarks. Available: sequential , random , grouped |
grouped |
--verbose-charts |
Generates more charts based on the --benchmark-verbose factorio argument |
false |
Option | Description | Default |
---|---|---|
--factorio-path <PATH> |
An explicit path to the factorio binary | Auto-detected |
--verbose |
Shows all debug statements | false |
# Run a benchmark on the my-saves directory for 6000 ticks per run, and running each save file 3 times.
belt benchmark ./my-saves --ticks 6000 --runs 3
# Run a benchmark on the my-saves directory, only matching save files that start with "science" and outputting it to science-results/results.{csv,md}
belt benchmark ./my-saves --pattern science --output science-results
# Run a benchmark on the my-saves directory, with an explicit path to the factorio binary
belt --factorio-path /path/to/factorio benchmark ./my-saves
# Run a benchmark on the my-saves directory and a mod directory
belt --factorio-path /path/to/factorio --mods-dir /path/to/mods benchmark ./my-saves
While belt benchmark
offers sensible default, optimizing --ticks
and --runs
can refine your results. --ticks
sets the simulation duration per run, while --runs
determines the number of repetitions. Through testing, I've found that fewer runs with more tickS generally offers the most consistent UPS results for the shortest overall benchmark time, by reducing overhead from repeated Factorio launches. Experiment with these values for your specific saevs to find the optimal balance for accuracy and speed.
Any help is welcome. Whether you have never written a line of code, or simply don't know Rust. This is what the CI/CD pipeline is for! Bug reports and feature requests can be submitting through GitHub Issues.
If you want to contribute, please open an issue to discuss the proposed changes before submitting a pull request.
On every push a linter and formatter checks the code, so just write the code however you want and fix any errors that occur.
[!NOTE] To do this locally, run
cargo fmt
andcargo clippy -- -D warnings
I follow the Conventional Commits specification as a standard for my commit messages, I can only encourage you do the same.