-
Notifications
You must be signed in to change notification settings - Fork 116
Benchmarking automatically #795
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
Open
mjp41
wants to merge
40
commits into
main
Choose a base branch
from
benchmarking
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
da5a310
Benchmarking automatically
mjp41 98bbcda
WIP
mjp41 7227e27
WIP
mjp41 5b786da
Add caching
mjp41 e6965ad
Alter connecting to image.
mjp41 31718db
Alter connecting to image.
mjp41 43b7f4e
Alter connecting to image.
mjp41 55fadf7
Alter connecting to image.
mjp41 3a8acdd
Alter connecting to image.
mjp41 7a709a7
Alter connecting to image.
mjp41 0b479c0
Alter connecting to image.
mjp41 5a20692
Alter connecting to image.
mjp41 e314c10
Investigate usage
mjp41 9e6b1eb
Investigate usage
mjp41 c933308
Investigate usage
mjp41 b5efe7b
Investigate usage
mjp41 244c079
Compacting.
mjp41 bfb665d
Compacting.
mjp41 5aff3a3
Compacting.
mjp41 84dd7ae
Apply suggestion from @achamayou
mjp41 6a28074
Adjust output for bencher.dev
mjp41 bee8d8d
Add script
mjp41 8767137
Adjust python deps
mjp41 fef6300
Adjust python deps
mjp41 c4a8d3e
Adjust python deps
mjp41 93ad1c7
Adjust python deps
mjp41 1d132ac
Fix path
mjp41 e7a44e5
Fix path
mjp41 73dee9b
Move around deps.
mjp41 47f46ff
Set to correct benchmarking.
mjp41 20a2346
Change name
mjp41 37d7624
Add cron
mjp41 c964172
Update script to handle multiple allocators
mjp41 d2e049a
Put output in right place.
mjp41 83df851
Refinements
mjp41 dfc8a2c
refinement
mjp41 f501e3f
refinement
mjp41 b23d006
Script is now upstreamed to benchmarks.
mjp41 26f44e9
Disable GWP Asan jemalloc test
mjp41 461c23f
Update Dockerfile
mjp41 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: snmalloc Benchmarking CI | ||
|
||
# The following should ensure that the workflow only runs a single set of actions | ||
# for each PR. But it will not apply this to pushes to the main branch. | ||
concurrency: | ||
group: benchmarking${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
||
# Controls when the workflow will run | ||
on: | ||
schedule: | ||
- cron: "0 0 * * 1" # Runs every Monday at midnight UTC | ||
# Triggers the workflow on push or pull request events but only for the master branch | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
benchmark: | ||
runs-on: [self-hosted, 1ES.Pool=snmalloc-perf] | ||
|
||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
# Setup docker buildx | ||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Build and run benchmarks in Docker | ||
id: docker_build | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: benchmark/Dockerfile | ||
push: false | ||
load: true | ||
tags: snmalloc-bench | ||
build-args: | | ||
benchs=allt | ||
repeats=5 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
# Extracts the benchmark results from the Docker container | ||
- name: Extract Benchmark Results | ||
run: | | ||
docker cp `docker run -d ${{ steps.docker_build.outputs.imageid }}`:/bencher.dev.sn.json . | ||
|
||
# Uploads the benchmark results as an artifact | ||
- name: Upload Benchmark Results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: benchmark-results | ||
path: bencher.dev.sn.json | ||
|
||
# Upload to graphing service | ||
- uses: bencherdev/bencher@main | ||
- name: Upload benchmark results to Bencher | ||
run: | | ||
bencher run \ | ||
--project snmalloc \ | ||
--token '${{ secrets.BENCHER_DEV_API_TOKEN }}' \ | ||
--branch main \ | ||
--adapter json \ | ||
--err \ | ||
--file bencher.dev.sn.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
FROM ubuntu:24.04 | ||
|
||
# Pull mimalloc-bench | ||
RUN apt-get update && apt-get install -y --no-install-recommends git gpg ca-certificates python3-numpy | ||
RUN git clone https://github.com/daanx/mimalloc-bench &&\ | ||
cd mimalloc-bench && \ | ||
git reset --hard a4ce904286365c7adfba54f0eea3a2df3fc95bd1 | ||
|
||
WORKDIR /mimalloc-bench | ||
# Install dependencies | ||
RUN ./build-bench-env.sh packages | ||
|
||
# Tidy up apt cache | ||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Build benchmarks | ||
RUN ./build-bench-env.sh bench | ||
|
||
RUN ./build-bench-env.sh redis | ||
|
||
RUN ./build-bench-env.sh rocksdb \ | ||
&& find /mimalloc-bench/extern/rocksdb-8.1.1 -name "*.o" -delete | ||
|
||
RUN ./build-bench-env.sh lean \ | ||
&& find /mimalloc-bench/extern/lean -name "*.o" -delete | ||
|
||
RUN echo "sn /snmalloc/build/libsnmallocshim.so" > /allocs.txt | ||
|
||
# Build allocator | ||
RUN mkdir -p /snmalloc | ||
COPY . /snmalloc | ||
|
||
RUN mkdir -p /snmalloc/build | ||
WORKDIR /snmalloc/build | ||
RUN cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. | ||
RUN ninja libsnmallocshim.so | ||
|
||
# Run benchmarks | ||
ARG benchs=allt | ||
ARG repeats=1 | ||
WORKDIR /mimalloc-bench/out/bench | ||
RUN ../../bench.sh --external=/allocs.txt $benchs -r=$repeats | ||
|
||
WORKDIR / | ||
RUN python3 /mimalloc-bench/scripts/bencher.dev.py /mimalloc-bench/out/bench/benchres.csv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
I don't think that bit will work because the PRs won't have access to secrets? But then perhaps this is for testing on this PR?