fix: optimize read-inline-info #7
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: | |
| benchmark: | |
| - testdata/take_strings | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| # Skip installing package docs to avoid wasting time when installing valgrind | |
| # 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 | |
| # Cache Valgrind build to speed up CI | |
| # | |
| - name: Cache Valgrind build | |
| id: cache-valgrind | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| /usr/local/lib/valgrind | |
| /usr/local/bin/valgrind | |
| /usr/local/libexec/valgrind | |
| /usr/local/share/doc/valgrind | |
| /usr/local/share/man/man1/valgrind* | |
| key: valgrind-build-${{ hashFiles('**/*.c', '**/*.h', '**/*.am', 'configure.ac', 'autogen.sh') }} | |
| restore-keys: | | |
| valgrind-build- | |
| # Build and install Valgrind | |
| # | |
| - name: Update apt-get cache | |
| if: steps.cache-valgrind.outputs.cache-hit != 'true' | |
| run: sudo apt-get update | |
| - name: Install build dependencies | |
| if: steps.cache-valgrind.outputs.cache-hit != 'true' | |
| run: | | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| automake \ | |
| autoconf \ | |
| libc6-dev \ | |
| gdb \ | |
| docbook \ | |
| docbook-xsl \ | |
| docbook-xml \ | |
| xsltproc | |
| - name: Run autogen | |
| if: steps.cache-valgrind.outputs.cache-hit != 'true' | |
| run: ./autogen.sh | |
| - name: Configure | |
| if: steps.cache-valgrind.outputs.cache-hit != 'true' | |
| run: ./configure | |
| - name: Build Valgrind | |
| if: steps.cache-valgrind.outputs.cache-hit != 'true' | |
| run: make -j$(nproc) | |
| - name: Install valgrind | |
| if: steps.cache-valgrind.outputs.cache-hit != 'true' | |
| run: sudo make install | |
| - name: Verify Valgrind installation | |
| run: | | |
| valgrind --version | |
| which valgrind | |
| # Setup benchmarks and run them | |
| # | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Run the benchmarks | |
| uses: CodSpeedHQ/action@main | |
| env: | |
| # We currently don't support sub-processes in benchmarks, since we won't find the | |
| # benchmark root frame when using the process with most samples. | |
| CODSPEED_PERF_ENABLED: false | |
| with: | |
| working-directory: bench | |
| mode: walltime | |
| run: uv run bench.py --binary-path ${{ matrix.benchmark }} |