fix: optimize read-inline-info #69
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: CodSpeed Benchmarks | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| benchmarks: | |
| runs-on: codspeed-macro | |
| strategy: | |
| matrix: | |
| # IMPORTANT: The binary has to match the architecture of the runner! | |
| cmd: | |
| - bench/testdata/take_strings-aarch64 | |
| - ls -alh NEWS NEWS.old NEWS.older | |
| - echo Hello, World! | |
| - tar czf /tmp/news.tar.gz NEWS NEWS.old NEWS.older | |
| - python3 bench/fib.py | |
| valgrind: | |
| - "3.26.0" | |
| - "3.25.1" | |
| - "local" | |
| exclude: | |
| # Skip take_strings with 3.25.0 as it takes too long to complete | |
| - cmd: bench/testdata/take_strings-aarch64 | |
| valgrind: "3.25.1" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - uses: extractions/setup-just@v3 | |
| # Skip installing package docs to avoid wasting time when installing build dependencies | |
| # See: https://github.com/actions/runner-images/issues/10977#issuecomment-2810713336 | |
| - name: Skip installing package docs | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo tee /etc/dpkg/dpkg.cfg.d/01_nodoc > /dev/null << 'EOF' | |
| path-exclude /usr/share/doc/* | |
| path-exclude /usr/share/man/* | |
| path-exclude /usr/share/info/* | |
| EOF | |
| - name: Cache Valgrind build | |
| uses: actions/cache@v4 | |
| id: valgrind-cache | |
| with: | |
| path: /tmp/valgrind-upstream | |
| key: valgrind-${{ matrix.valgrind }}-${{ runner.os }}-build | |
| # Build and install Valgrind | |
| - name: Update apt-get cache | |
| if: steps.valgrind-cache.outputs.cache-hit != 'true' | |
| run: | | |
| sudo apt-get update | |
| # Remove existing Valgrind installation | |
| sudo apt-get remove -y valgrind || true | |
| - name: Install build dependencies | |
| if: steps.valgrind-cache.outputs.cache-hit != 'true' | |
| run: | | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| automake \ | |
| autoconf \ | |
| gdb \ | |
| docbook \ | |
| docbook-xsl \ | |
| docbook-xml \ | |
| xsltproc | |
| - name: Build Valgrind (${{ matrix.valgrind }}) | |
| if: steps.valgrind-cache.outputs.cache-hit != 'true' | |
| run: just build ${{ matrix.valgrind }} | |
| - name: Install Valgrind (${{ matrix.valgrind }}) | |
| run: | | |
| just install ${{ matrix.valgrind }} | |
| # Ensure libc6-dev is installed for Valgrind to work properly | |
| sudo apt-get update | |
| sudo apt-get install -y libc6-dev | |
| - name: Verify Valgrind build | |
| run: /usr/local/bin/valgrind --version | |
| # Setup benchmarks and run them | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Run the benchmarks | |
| uses: CodSpeedHQ/action@main | |
| with: | |
| mode: walltime | |
| run: ./bench/bench.py --cmd "${{ matrix.cmd }}" --valgrind-path /usr/local/bin/valgrind |