-
Notifications
You must be signed in to change notification settings - Fork 156
Add script and workflow for benchmarking #317
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
base: master
Are you sure you want to change the base?
Conversation
|
GitHub Actions provides standard GitHub-hosted runners for Ubuntu on Arm64. This makes it practical to evaluate Arm32 execution on Arm64 using QEMU user-mode emulation, which typically offers better performance than running Arm32 emulation on x86-64 hosts. |
32c4e18 to
6e0b0ba
Compare
Since any source code changes may affect the performance of the
bootstrapping process, this commit adds a new Python script to measure
its performance.
The Python script provides the following arguments:
- Host C compiler (--hostcc)
- Target architecture (--arch)
- Enable dynamic linking (--dynlink)
- Number of runs (--runs)
- Output json file name (--output-json)
After executing the script, it repeatedly runs the bootstrapping process
for the compiler, calculates the average execution time and maximum
memory usage during the runs, and then stores the results in the
specified file while displaying them to the user via standard output.
Additionally, Makefile also adds two new targets:
- 'bench': run the benchmarking script using the given configuration.
e.g.:
$ make bench # default configuration
$ make bench CC=clang # Use clang as host C compiler
$ make bench ARCH=arm DYNLINK=1 # Arm + Dynamic linking
$ make bench BENCH_RUNS=10 # 10 runs
$ make bench \
BENCH_OUTPUT_JSON=out.json # Output json filename
- 'all-bench': run the benchmarking script for the following
configurations:
- (ARCH, DYNLINK) = (arm, static)
- (ARCH, DYNLINK) = (riscv, statis)
- (ARCH, DYNLINK) = (arm, dynamic)
CC can be optionally determined by the user to use GCC or Clang.
e.g.:
$ make all-bench
$ make all-bench CC=clang
744e3c7 to
9beb7b1
Compare
The new workflow has been modified to use arm64 runners. Since no C source files were changed, the workflow does not execute the third and fourth steps. Reference: result in my repository |
|
Because GitHub does not provide RISC-V runners, we can only measure the bootstrapping performance of shecc targeting the RISC-V architecture by running RISC-V emulation on x86-64 hosts. |
|
I created a new We can observe that the workflow uses Arm64 runners together with QEMU to execute |
Would it be worthwhile to switch to Arm64-based runners? If so, submit a pull request to implement the transition. |
The proposed changes aim to resolve #236 so that we can observe the performance of the bootstrapping when shecc's source code is changed.
Benchmarking script
First, a new Python script (
tests/bench.py) is introduced to run the bootstrapping process and calculate the average execution time and max RSS. The usage of this new script is shown as follows:Combined with
make:New workflow
This new workflow is still a work in progress and will integrate GitHub Action for Continuous Benchmarking, allowing us to view the statistics in another GitHub repository, similar to
rv32emu.The current definitions can check whether shecc's source code has changed. If so, the workflow continues to execute the subsequent steps to install the dependencies and run the benchmarking script via
make.TODO:
shecc-bench)sysprog21to create a repository.Summary by cubic
Adds a benchmarking script and a CI workflow to measure shecc bootstrapping performance (average time and max RSS) and spot regressions when core code changes. Addresses #236.
Written for commit 96c3fd3. Summary will update on new commits.