Saving and Loading Results

Benchmarking results can be saved / loaded using PkgJogger.save_benchmarks and PkgJogger.load_benchmarks. These methods build on BenchmarkTools' offering by:

  • Compressing the output file using gzip
  • Additional information such as:
    • Julia Version, Commit and Build Date
    • System Information (Essentially everything in Sys)
    • Timestamp when the results get saved
    • Git Information, if run from a Git Repository
    • The version of PkgJogger used to save the results

Overall the resulting files are ~10x smaller, despite capturing additional information.

Saving with JogPkgName

In addition to PkgJogger.save_benchmarks, the generated JogPkgName module provides JogPkgName.save_benchmarks for saving results to a consistent location.

using AwesomePkg
using PkgJogger

# Run AwesomePkg's Benchmarks
@jog AwesomePkg
results = JogAwesomePkg.benchmark()

# Saves results to BENCH_DIR/trial/UUID.bson.gz and returns the filename used
JogAwesomePkg.save_benchmarks(results)

# Or run and save the benchmarks in a single step, the filename saved to
# will be reported in an @info message
JogAwesomePkg.benchmark(; save = true)

See also: JogExample.save_benchmarks

Methods

PkgJogger.save_benchmarksFunction
save_benchmarks(filename, results::BenchmarkGroup)

Save benchmarking results to filename.bson.gz for later analysis.

File Contents

  • Julia Version, Commit and Commit date
  • System Information
  • Timestamp
  • Benchmarking Results
  • Git Commit, 'Is Dirty' status and author datetime
  • PkgJogger Version used to save the file

File Format:

Results are saved as a gzip compressed BSON file and can be loaded with PkgJogger.load_benchmarks

source
PkgJogger.load_benchmarksFunction
load_benchmarks(filename::String)::Dict

Load benchmarking results from filename

Prior to v0.4 PkgJogger saved results as *.json.gz instead of *.bson.gz. This function supports both formats. However, the *.json.gz format is deprecated, and may not support all features.

source