Wire AMO, HESS, VMPC into core allocation path #74
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
| name: CI | |
| on: | |
| push: | |
| branches: [main, feature/*] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: cachix/install-nix-action@v27 | |
| with: | |
| nix_path: nixpkgs=channel:nixos-unstable | |
| - name: Cache Nix store | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/nix | |
| /nix/store | |
| key: nix-${{ runner.os }}-${{ hashFiles('**/Cargo.lock', '**/flake.nix', '**/flake.lock') }} | |
| restore-keys: | | |
| nix-${{ runner.os }}- | |
| - name: Cache Cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| cargo-${{ runner.os }}- | |
| - name: Build | |
| run: nix build | |
| - name: Run tests | |
| run: nix develop -c cargo test --all | |
| - name: Check formatting | |
| run: nix develop -c cargo fmt --check | |
| - name: Clippy | |
| run: nix develop -c cargo clippy --all -- -D warnings | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: libaethalloc | |
| path: result/lib/*.so | |
| benchmarks: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: libaethalloc | |
| path: ./lib | |
| - name: Compile benchmarks | |
| run: | | |
| gcc -O3 -pthread benches/packet_churn.c -o /tmp/packet_churn | |
| gcc -O3 -pthread benches/kv_store.c -o /tmp/kv_store | |
| gcc -O3 -pthread benches/producer_consumer.c -o /tmp/producer_consumer | |
| gcc -O3 -pthread benches/multithread_churn.c -o /tmp/multithread_churn | |
| gcc -O3 -pthread benches/fragmentation.c -o /tmp/fragmentation | |
| gcc -O3 -pthread benches/realloc_churn.c -o /tmp/realloc_churn | |
| gcc -O3 -pthread benches/realloc_large.c -o /tmp/realloc_large | |
| gcc -O3 -pthread benches/fragmentation_churn.c -o /tmp/fragmentation_churn | |
| - name: Packet Churn | |
| run: | | |
| echo "GLIBC=$(/tmp/packet_churn | jq -r '.throughput_ops_per_sec')" >> $GITHUB_ENV | |
| echo "AETHALLOC=$(LD_PRELOAD=$(realpath lib/*.so) /tmp/packet_churn | jq -r '.throughput_ops_per_sec')" >> $GITHUB_ENV | |
| - name: KV Store | |
| run: | | |
| echo "GLIBC_KV=$(/tmp/kv_store | jq -r '.throughput_ops_per_sec')" >> $GITHUB_ENV | |
| echo "AETHALLOC_KV=$(LD_PRELOAD=$(realpath lib/*.so) /tmp/kv_store | jq -r '.throughput_ops_per_sec')" >> $GITHUB_ENV | |
| - name: Producer-Consumer | |
| run: | | |
| echo "GLIBC_PC=$(/tmp/producer_consumer | jq -r '.throughput_ops_per_sec')" >> $GITHUB_ENV | |
| echo "AETHALLOC_PC=$(LD_PRELOAD=$(realpath lib/*.so) /tmp/producer_consumer | jq -r '.throughput_ops_per_sec')" >> $GITHUB_ENV | |
| - name: Multithread Churn | |
| run: | | |
| echo "GLIBC_MT=$(/tmp/multithread_churn | jq -r '.throughput_ops_per_sec')" >> $GITHUB_ENV | |
| echo "AETHALLOC_MT=$(LD_PRELOAD=$(realpath lib/*.so) /tmp/multithread_churn | jq -r '.throughput_ops_per_sec')" >> $GITHUB_ENV | |
| - name: Fragmentation | |
| run: | | |
| echo "GLIBC_RSS=$(/tmp/fragmentation | jq -r '.summary.final_rss_kb')" >> $GITHUB_ENV | |
| echo "AETHALLOC_RSS=$(LD_PRELOAD=$(realpath lib/*.so) /tmp/fragmentation | jq -r '.summary.final_rss_kb')" >> $GITHUB_ENV | |
| - name: Realloc Churn | |
| run: | | |
| echo "GLIBC_REALLOC=$(/tmp/realloc_churn 100000 2 | jq -r '.latency_ns.avg')" >> $GITHUB_ENV | |
| echo "AETHALLOC_REALLOC=$(LD_PRELOAD=$(realpath lib/*.so) /tmp/realloc_churn 100000 2 | jq -r '.latency_ns.avg')" >> $GITHUB_ENV | |
| - name: Realloc Large | |
| run: | | |
| echo "GLIBC_REALLOC_LARGE=$(/tmp/realloc_large 10000 | jq -r '.latency_ns.avg')" >> $GITHUB_ENV | |
| echo "AETHALLOC_REALLOC_LARGE=$(LD_PRELOAD=$(realpath lib/*.so) /tmp/realloc_large 10000 | jq -r '.latency_ns.avg')" >> $GITHUB_ENV | |
| - name: Fragmentation Churn | |
| run: | | |
| echo "GLIBC_FRAG_CHURN=$(/tmp/fragmentation_churn 50000 10000 | jq -r '.latency_ns.avg')" >> $GITHUB_ENV | |
| echo "AETHALLOC_FRAG_CHURN=$(LD_PRELOAD=$(realpath lib/*.so) /tmp/fragmentation_churn 50000 10000 | jq -r '.latency_ns.avg')" >> $GITHUB_ENV | |
| stress-tests: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: libaethalloc | |
| path: ./lib | |
| - name: Compile stress tests | |
| run: | | |
| gcc -O3 benches/tail_latency.c -o /tmp/tail_latency | |
| gcc -O3 benches/massive_alloc.c -o /tmp/massive_alloc | |
| gcc -O3 benches/corruption_test.c -o /tmp/corruption_test | |
| - name: Tail Latency | |
| run: | | |
| echo "=== GLIBC ===" && /tmp/tail_latency 8 10000 || echo "glibc tail latency failed" | |
| echo "=== AETHALLOC ===" && LD_PRELOAD=$(realpath lib/*.so) /tmp/tail_latency 8 10000 || echo "aethalloc tail latency failed" | |
| - name: Massive Allocations | |
| run: | | |
| echo "=== GLIBC ===" && /tmp/massive_alloc || echo "glibc massive alloc failed" | |
| echo "=== AETHALLOC ===" && LD_PRELOAD=$(realpath lib/*.so) /tmp/massive_alloc || echo "aethalloc massive alloc failed" | |
| - name: Corruption Test | |
| run: LD_PRELOAD=$(realpath lib/*.so) /tmp/corruption_test || echo "corruption test failed" | |
| macro-benchmark: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: libaethalloc | |
| path: ./lib | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Clone ripgrep | |
| run: cd /tmp && git clone --depth 1 https://github.com/BurntSushi/ripgrep.git | |
| - name: Build ripgrep (glibc) | |
| run: | | |
| echo "=== GLIBC ===" | |
| time cargo build --release --manifest-path /tmp/ripgrep/Cargo.toml 2>&1 | tail -5 | |
| - name: Clean and rebuild (aethalloc) | |
| run: | | |
| cargo clean --manifest-path /tmp/ripgrep/Cargo.toml | |
| echo "=== AETHALLOC ===" | |
| time bash -c 'LD_PRELOAD=$(realpath lib/*.so) cargo build --release --manifest-path /tmp/ripgrep/Cargo.toml 2>&1 | tail -5' | |
| metrics-overhead: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: cachix/install-nix-action@v27 | |
| with: | |
| nix_path: nixpkgs=channel:nixos-unstable | |
| - name: Cache Cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| aethalloc-metrics/target | |
| key: metrics-cargo-${{ runner.os }}-${{ hashFiles('aethalloc-metrics/Cargo.lock') }} | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: libaethalloc | |
| path: ./lib | |
| - name: Build aethalloc-metrics | |
| run: cd aethalloc-metrics && cargo build --release | |
| - name: Compile benchmark | |
| run: gcc -O3 -pthread benches/packet_churn.c -o /tmp/packet_churn | |
| - name: Test without metrics | |
| run: | | |
| echo "=== WITHOUT METRICS ===" | |
| for i in 1 2 3; do | |
| LD_PRELOAD=$(realpath lib/*.so) /tmp/packet_churn | jq -r '.throughput_ops_per_sec' | |
| done | |
| - name: Test with metrics library (not started) | |
| run: | | |
| echo "=== WITH METRICS LIBRARY (not started) ===" | |
| for i in 1 2 3; do | |
| LD_PRELOAD="$(realpath lib/*.so):$(realpath aethalloc-metrics/target/release/libaethalloc_metrics.so)" /tmp/packet_churn | jq -r '.throughput_ops_per_sec' | |
| done |