Bash script to help benchmark the compiler #6076
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a script that compiles a sway project across multiple commits, and generates an HTML report to help analysis of compilation time and binary size.
The report is 100% autonomous, only depending on CDN scripts, and can be served as it is by any HTTP server. There are two main features worthy of being noted: a pivot table, and the data table.
The pivot table is configured by default to show the average compilation time across multiple commits, like the example below.
Below it, one finds the data table used, with links to Github issues and commits.
The script help can be printed by invoking it without any arguments
A good first invocation example is:
The script tries to be gentle on printing to the terminal, so details are redirected to
$HOME/.cache/sway-bench/log.txt
, which can betail -f
if needed.So the only feedback is that for each commit, it prints:
forc
, running the benchmark and calculating the binary size.The script runs incrementally. So it never redo a step if its results exist in the cache. A second consecutive run should not do anything. This is particularly important when compiling all the multiple versions of
forc
, which can take quite a long time!The option
-o
will open the browser pointing to the report after everything is finished.An important detail is disk usage. At the end of the script, it reminds you how much space is being used. Each
forc
version is consuming more than 50MB. One can easily clean this with--clean
. It asks permission before deleting anything, but it is always important to double-check if it is not doing something crazy.If you have a specific branch you want to test, you can try
Suggestions and improvements are welcomed.
Checklist
Breaking*
orNew Feature
labels where relevant.