-
-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add plot_benchmarks scripts #806
base: master
Are you sure you want to change the base?
Conversation
The script is intended for a collection of hyperfine JSON files where multiple benchmarks were run for a selected group of commands.
import matplotlib.pyplot as plt | ||
import numpy as np | ||
|
||
parser = argparse.ArgumentParser(description=__doc__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the comment above be a docstring in order for this to work?
parser.add_argument( | ||
"files", nargs="+", type=pathlib.Path, help="JSON files with benchmark results" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could add a note here that all files must include results with the same commands? Or maybe that should be described in the top-level doc string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thank you very much. Can we maybe find a more descriptive name for this script? Maybe something like plot_benchmark_comparison
or plot_grouped_comparison
?
The script is intended for a collection of hyperfine JSON files where multiple benchmarks were run for a selected group of commands.
There are various projects that use such graphs:
https://github.com/rui314/mold?tab=readme-ov-file#mold-a-modern-linker
https://github.com/gimli-rs/addr2line?tab=readme-ov-file#performance
A sample output graph from the suggested script:
