BENCHMARKS.md

July 14, 2023 · View on GitHub

I use https://github.com/sharkdp/hyperfine to benchmark, which makes it easy to get consistent benchmarks. Note that benchmarks are done with cache only. While it's interesting to see the performance improvement on a cold cache, it's not representative of the performance of the tool in a real-world scenario, since most of the time the cache will be warm. To run these benchmarks on your application, you can place this repo next to your rails application and run bash ../pks/dev/run_benchmarks.sh from the root of your application

Hot Cache, with and without spring, entire codebase

CommandMean [s]Min [s]Max [s]Relative
../pks/target/release/pks update2.219 ± 0.2212.0492.4691.00
../pks/target/release/pks --experimental-parser update2.506 ± 0.2602.3162.8031.13 ± 0.16
DISABLE_SPRING=1 bin/packwerk update29.653 ± 2.32927.12231.70613.37 ± 1.70
bin/packwerk update21.439 ± 2.53519.08024.1209.66 ± 1.49

Hot Cache, with and without spring, single file

CommandMean [ms]Min [ms]Max [ms]Relative
../pks/target/release/pks check config/initializers/inflections.rb579.9 ± 22.7564.6606.01.00
../pks/target/release/pks --experimental-parser check config/initializers/inflections.rb1041.3 ± 10.61031.71052.71.80 ± 0.07
DISABLE_SPRING=1 bin/packwerk check config/initializers/inflections.rb16693.2 ± 455.816361.617213.028.79 ± 1.37
bin/packwerk check config/initializers/inflections.rb6749.6 ± 106.06658.26865.811.64 ± 0.49