Benchmarks #63
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: Benchmarks | |
| on: | |
| # Disabled on push/PR until path issues resolved | |
| # push: | |
| # branches: [ main ] | |
| # pull_request: | |
| # branches: [ main ] | |
| schedule: | |
| # Run weekly on Monday at 3 AM UTC | |
| - cron: '0 3 * * 1' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write # Needed to commit benchmark results | |
| jobs: | |
| benchmark: | |
| name: Run Benchmarks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| cmake \ | |
| libglfw3-dev \ | |
| libgl1-mesa-dev \ | |
| libglu1-mesa-dev \ | |
| libcurl4-openssl-dev \ | |
| xorg-dev \ | |
| libbenchmark-dev | |
| - name: Cache dependencies | |
| uses: actions/cache@v6 | |
| with: | |
| path: | | |
| external/imgui | |
| external/json | |
| external/implot | |
| key: benchmark-deps-imgui-1.92.4-json-3.11.3-implot-0.17 | |
| restore-keys: | | |
| benchmark-deps- | |
| - name: Setup ImGui | |
| run: | | |
| if [ ! -d "external/imgui" ]; then | |
| mkdir -p external | |
| cd external | |
| git clone https://github.com/ocornut/imgui.git && git -C imgui checkout --detach 9a5d5c45f54b1301ea471622eddede70384243af # v1.92.4 | |
| fi | |
| - name: Setup nlohmann/json | |
| run: | | |
| if [ ! -d "external/json" ]; then | |
| mkdir -p external | |
| cd external | |
| git clone https://github.com/nlohmann/json.git && git -C json checkout --detach 9cca280a4d0ccf0c08f47a99aa71d1b0e52f8d03 # v3.11.3 | |
| fi | |
| - name: Setup ImPlot | |
| run: | | |
| if [ ! -d "external/implot" ]; then | |
| mkdir -p external | |
| cd external | |
| git clone https://github.com/epezent/implot.git && git -C implot checkout --detach 4707b245fbcd69075b1a8a74fa8d2435561b3134 # v0.17 | |
| fi | |
| - name: Configure with benchmarks | |
| run: | | |
| cmake -B build \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DBUILD_BENCHMARKS=ON \ | |
| -DBUILD_TESTS=OFF | |
| - name: Build | |
| run: cmake --build build --parallel | |
| - name: Run benchmarks | |
| run: | | |
| cd build | |
| ./benchmarks/MetaImGUI_benchmarks \ | |
| --benchmark_out=benchmark_results.json \ | |
| --benchmark_out_format=json \ | |
| --benchmark_repetitions=3 | |
| - name: Store benchmark result | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| if: false # Disabled - requires gh-pages branch setup | |
| with: | |
| tool: 'googlecpp' | |
| output-file-path: build/benchmark_results.json | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| auto-push: false | |
| alert-threshold: '150%' | |
| comment-on-alert: true | |
| fail-on-alert: false | |
| alert-comment-cc-users: '@andynicholson' | |
| - name: Upload benchmark results | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: benchmark-results | |
| path: build/benchmark_results.json | |
| retention-days: 90 | |
| - name: Generate summary | |
| run: | | |
| echo "## Benchmark Results" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| cd build | |
| ./benchmarks/MetaImGUI_benchmarks --benchmark_filter=. | head -n 50 >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "📊 Full results available in artifacts" >> $GITHUB_STEP_SUMMARY | |