fix: optimize read-inline-info #30
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! | |
| benchmark: | |
| - testdata/take_strings-aarch64 | |
| valgrind: | |
| - /usr/bin/valgrind | |
| - ../vg-in-place | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| # 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 | |
| # Build and install Valgrind | |
| - name: Update apt-get cache | |
| run: sudo apt-get update | |
| - name: Install build dependencies | |
| run: | | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| automake \ | |
| autoconf \ | |
| libc6-dev \ | |
| gdb \ | |
| docbook \ | |
| docbook-xsl \ | |
| docbook-xml \ | |
| xsltproc | |
| - name: Run autogen | |
| run: ./autogen.sh | |
| - name: Configure | |
| run: ./configure | |
| - name: Build Valgrind | |
| run: | | |
| make -j$(nproc) | |
| - name: Verify Valgrind build | |
| run: | | |
| # Verify that vg-in-place script exists | |
| test -f ./vg-in-place || { echo "vg-in-place not found!"; exit 1; } | |
| # Test valgrind works with vg-in-place | |
| ./vg-in-place --version | |
| ./vg-in-place --tool=callgrind --help > /dev/null || { echo "callgrind tool not accessible!"; exit 1; } | |
| echo "Valgrind build successful and callgrind tool is accessible" | |
| # Install upstream Valgrind for comparison | |
| - name: Install upstream Valgrind | |
| run: sudo apt-get install -y valgrind | |
| # Setup benchmarks and run them | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| # Ensure that the runner doesn't install it's own valgrind by linking vg-in-place to /usr/local/bin/valgrind, | |
| # which makes the version check work correctly. | |
| - name: Link vg-in-place to /usr/local/bin/valgrind | |
| run: | | |
| sudo ln -sf "$PWD/vg-in-place" /usr/local/bin/valgrind | |
| valgrind --version | |
| which valgrind | |
| - name: "Path testing" | |
| env: | |
| PATH1: /usr/local/bin:$PATH | |
| PATH2: "/usr/local/bin:$PATH" | |
| PATH3: /usr/local/bin:${{ env.PATH }} | |
| PATH4: ${{ matrix.valgrind }}:$PATH | |
| run: | | |
| echo $PATH1 | |
| echo $PATH2 | |
| echo $PATH3 | |
| echo $PATH4 | |
| echo "/usr/local/bin/" >> $GITHUB_PATH | |
| - name: Run the benchmarks | |
| uses: CodSpeedHQ/action@main | |
| env: | |
| # We currently don't support sub-processes in benchmarks, since we cannot find the | |
| # benchmark root frame when using the process with most samples. | |
| CODSPEED_PERF_ENABLED: false | |
| # Prepend /usr/local/bin to PATH so the symlinked valgrind is resolved first | |
| with: | |
| working-directory: bench | |
| mode: walltime | |
| run: uv run bench.py --binary-path ${{ matrix.benchmark }} --valgrind-path ${{ matrix.valgrind }} |