|
| 1 | +name: Performance |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches-ignore: |
| 6 | + - '**-noperf' |
| 7 | + - 'tarantool/release/**' |
| 8 | + - 'upstream-**' |
| 9 | + tags-ignore: |
| 10 | + - '**' |
| 11 | + schedule: |
| 12 | + # Once a day at 03:00 to avoid clashing with runs for the |
| 13 | + # Tarantool benchmarks at midnight. |
| 14 | + - cron: '0 3 * * *' |
| 15 | + |
| 16 | +concurrency: |
| 17 | + # An update of a developer branch cancels the previously |
| 18 | + # scheduled workflow run for this branch. However, the default |
| 19 | + # branch, and long-term branch (tarantool/release/2.11, |
| 20 | + # tarantool/release/2.10, etc) workflow runs are never canceled. |
| 21 | + # |
| 22 | + # We use a trick here: define the concurrency group as 'workflow |
| 23 | + # run ID' + # 'workflow run attempt' because it is a unique |
| 24 | + # combination for any run. So it effectively discards grouping. |
| 25 | + # |
| 26 | + # XXX: we cannot use `github.sha` as a unique identifier because |
| 27 | + # pushing a tag may cancel a run that works on a branch push |
| 28 | + # event. |
| 29 | + group: ${{ startsWith(github.ref, 'refs/heads/tarantool/') |
| 30 | + && format('{0}-{1}', github.run_id, github.run_attempt) |
| 31 | + || format('{0}-{1}', github.workflow, github.ref) }} |
| 32 | + cancel-in-progress: true |
| 33 | + |
| 34 | +jobs: |
| 35 | + performance-luajit: |
| 36 | + # The 'performance' label _must_ be set only for the single |
| 37 | + # runner to guarantee that results are not dependent on the |
| 38 | + # machine. |
| 39 | + runs-on: |
| 40 | + - self-hosted |
| 41 | + - Linux |
| 42 | + - x86_64 |
| 43 | + - 'performance' |
| 44 | + |
| 45 | + env: |
| 46 | + PERF_BRANCH: ${{ github.ref_name }} |
| 47 | + PERF_COMMIT: ${{ github.sha }} |
| 48 | + |
| 49 | + strategy: |
| 50 | + fail-fast: false |
| 51 | + matrix: |
| 52 | + GC64: [ON, OFF] |
| 53 | + JOFF: [ON, OFF] |
| 54 | + # Run each job sequentially. |
| 55 | + max-parallel: 1 |
| 56 | + name: > |
| 57 | + LuaJIT |
| 58 | + GC64:${{ matrix.GC64 }} |
| 59 | + JOFF:${{ matrix.JOFF }} |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v4 |
| 62 | + with: |
| 63 | + fetch-depth: 0 |
| 64 | + submodules: recursive |
| 65 | + - name: setup performance environment |
| 66 | + uses: ./.github/actions/setup-performance |
| 67 | + - name: configure |
| 68 | + # The taskset alone will pin all the process threads |
| 69 | + # into a single (random) isolated CPU, see |
| 70 | + # https://bugzilla.kernel.org/show_bug.cgi?id=116701. |
| 71 | + # The workaround is using realtime scheduler for the |
| 72 | + # isolated task using chrt, e. g.: |
| 73 | + # sudo taskset 0xef chrt 50. |
| 74 | + # But this makes the process use non-standard, real-time |
| 75 | + # round-robin scheduling mechanism. |
| 76 | + run: > |
| 77 | + cmake -S . -B ${{ env.BUILDDIR }} |
| 78 | + -DCMAKE_BUILD_TYPE=RelWithDebInfo |
| 79 | + -DLUAJIT_ENABLE_PERF=ON |
| 80 | + -DLUAJIT_BENCH_INIT="taskset 0xfe chrt 50" |
| 81 | + -DLUAJIT_DISABLE_JIT=${{ matrix.JOFF }} |
| 82 | + -DLUAJIT_ENABLE_GC64=${{ matrix.GC64 }} |
| 83 | + - name: build |
| 84 | + run: cmake --build . --parallel |
| 85 | + working-directory: ${{ env.BUILDDIR }} |
| 86 | + - name: perf |
| 87 | + run: make LuaJIT-perf |
| 88 | + working-directory: ${{ env.BUILDDIR }} |
| 89 | + - name: aggregate benchmark results |
| 90 | + run: make LuaJIT-perf-aggregate |
| 91 | + working-directory: ${{ env.BUILDDIR }} |
| 92 | + - name: send statistics to InfluxDB |
| 93 | + # --silent -o /dev/null: Prevent dumping any reply part |
| 94 | + # in the output in case of an error. |
| 95 | + # --fail: Exit with the 22 error code is status >= 400. |
| 96 | + # --write-out: See the reason for the failure, if any. |
| 97 | + # --retry, --retry-delay: To avoid losing the results of |
| 98 | + # running after such a long job, try to retry sending the |
| 99 | + # results. |
| 100 | + run: > |
| 101 | + curl --request POST |
| 102 | + "${{ secrets.INFLUXDB_URL }}/api/v2/write?org=tarantool&bucket=luajit-performance&precision=s" |
| 103 | + --write-out "%{http_code}" |
| 104 | + --retry 5 |
| 105 | + --retry-delay 5 |
| 106 | + --connect-timeout 120 |
| 107 | + --fail --silent -o /dev/null |
| 108 | + --header "Authorization: Token ${{ secrets.INFLUXDB_TOKEN }}" |
| 109 | + --data-binary @./perf/output/summary.txt |
| 110 | + working-directory: ${{ env.BUILDDIR }} |
0 commit comments