Skip to content

Bench

Bench #35

Workflow file for this run

name: Bench
on:
workflow_dispatch:
inputs:
heaptrack:
description: "Run heaptrack memory benchmark"
required: true
default: false
type: boolean
jobs:
heaptrack:
if: ${{ github.event.inputs.heaptrack == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-heaptrack
- name: Install heaptrack
run: sudo apt-get install -y heaptrack
- name: Build server && client
run: cargo build -r -p heaptrack && npm i --prefix e2e/heaptrack
- name: Run memory benchmark
run: |
ulimit -n 20000
RUST_LOG="socketioxide=trace,engineioxide=trace,info" heaptrack target/release/heaptrack > server.txt &
cd e2e/heaptrack
node --experimental-strip-types client.ts > ../../client.txt &
sleep 60
kill $!
- name: Publish logs
uses: actions/upload-artifact@v4
with:
name: logs-${{ github.head_ref }}.${{ github.sha }}
path: "*.txt"
- name: Publish memory benchmark
uses: actions/upload-artifact@v4
with:
name: heaptrack-${{ github.head_ref }}.${{ github.sha }}
path: heaptrack.heaptrack.*