From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 4B7F815B9E80; Fri, 24 Oct 2025 14:13:19 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4B7F815B9E80 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1761304399; bh=Oyq2KBdvkko5ktPqy6LI0lT1qfnEyKudUbVCfZ5xAIs=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=MRZI96GNCAy7o0nZJNtIEIiXP2SEyhDrYrCSkdNIsgXVZXd9+eTHn04hwE13A8CMc nA989I43jX6CuBGftn9PlbUeEi7rA9KcNsogAAnDmAwUp4iI1kjABknEW1LWZ4uC5i 1QM7oHaA5znB1tGlyeciBe+ZsJfhFz+yvqvRHIGI= Received: from send172.i.mail.ru (send172.i.mail.ru [95.163.59.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id B77B015FB906 for ; Fri, 24 Oct 2025 14:00:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B77B015FB906 Received: by exim-smtp-855f5997bb-bv29s with esmtpa (envelope-from ) id 1vCFX6-00000000Cjy-2Jci; Fri, 24 Oct 2025 14:00:32 +0300 To: Sergey Bronnikov Date: Fri, 24 Oct 2025 14:00:35 +0300 Message-ID: <74c74521bf5b3d3c629b5e9337c3436d3145f1a4.1761301736.git.skaplun@tarantool.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD9CBA19EB9A1D5188A4A9468D3C99E3655D28669D1593CEE68182A05F5380850404C228DA9ACA6FE2708BFD8FE05AAC08C3DE06ABAFEAF670522504F2541F2018E52E7C6720268728E303B288D58C5C93A X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE70CB15FA6C489297DEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB55337566D857902A848E84F8725E622C83258A112A8B8AFCF35558A44DE9B4929E8614A8389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0A3E989B1926288338941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B652D31B9D28593E51CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB86D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE7E1BCFB2C0BE3F189731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A5C2B526D34B51435E5002B1117B3ED6960704215A6BD3914CB2920F75BA9A967F823CB91A9FED034534781492E4B8EEAD503B8C5F6188E145C79554A2A72441328621D336A7BC284946AD531847A6065A535571D14F44ED41 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF78330F95920C9ECE6C74502C7049BBD5BD1477438AAB05AC58C6DA184D6DE981F61CD9246542D0C46EB503EC62A3E87FAF64A38FB8B6A4FCA9F9C959907EF26BAFAE1C9F870AE7575F4332CA8FE04980913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVRN2q9QiacRueN0hcnOMlCc= X-DA7885C5: 170414DE8F63711EF255D290C0D534F985BD0FA6CF9450AA721F15511C8E7E8B4D20D495B437A1325B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393DDD5FD59B456EAD2B48ED760AC2F6E0F86A711D0FC59A5F07B84036AA30AB715E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: [Tarantool-patches] [PATCH v1 luajit 41/41] ci: introduce the performance workflow X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This patch adds the workflow to run benchmarks from various suites, aggregate their results, and send statistics to the InfluxDB to be processed later. The workflow contains a matrix to measure GC64 and non-GC64 modes with enabled/disabled JIT for x64 architecture. --- .github/actions/setup-performance/README.md | 10 ++ .github/actions/setup-performance/action.yml | 18 +++ .github/workflows/performance.yml | 110 +++++++++++++++++++ 3 files changed, 138 insertions(+) create mode 100644 .github/actions/setup-performance/README.md create mode 100644 .github/actions/setup-performance/action.yml create mode 100644 .github/workflows/performance.yml diff --git a/.github/actions/setup-performance/README.md b/.github/actions/setup-performance/README.md new file mode 100644 index 00000000..4c4bbdab --- /dev/null +++ b/.github/actions/setup-performance/README.md @@ -0,0 +1,10 @@ +# Setup performance + +Action setups the performance on Linux runners. + +## How to use Github Action from Github workflow + +Add the following code to the running steps before LuaJIT configuration: +``` +- uses: ./.github/actions/setup-performance +``` diff --git a/.github/actions/setup-performance/action.yml b/.github/actions/setup-performance/action.yml new file mode 100644 index 00000000..24d07440 --- /dev/null +++ b/.github/actions/setup-performance/action.yml @@ -0,0 +1,18 @@ +name: Setup performance +description: The Linux machine setup for running LuaJIT benchmarks +runs: + using: composite + steps: + - name: Setup CI environment (Linux) + uses: ./.github/actions/setup-linux + - name: Install dependencies for the LuaJIT benchmarks + run: | + apt -y update + apt install -y luarocks curl + shell: bash + - name: Install Lua modules + run: luarocks install lua-cjson + shell: bash + - name: Run script to setup Linux environment + run: sh ./perf/helpers/setup_env.sh + shell: bash diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml new file mode 100644 index 00000000..bfb6be97 --- /dev/null +++ b/.github/workflows/performance.yml @@ -0,0 +1,110 @@ +name: Performance + +on: + push: + branches-ignore: + - '**-noperf' + - 'tarantool/release/**' + - 'upstream-**' + tags-ignore: + - '**' + schedule: + # Once a day at 03:00 to avoid clashing with runs for the + # Tarantool benchmarks at midnight. + - cron: '0 3 * * *' + +concurrency: + # An update of a developer branch cancels the previously + # scheduled workflow run for this branch. However, the default + # branch, and long-term branch (tarantool/release/2.11, + # tarantool/release/2.10, etc) workflow runs are never canceled. + # + # We use a trick here: define the concurrency group as 'workflow + # run ID' + # 'workflow run attempt' because it is a unique + # combination for any run. So it effectively discards grouping. + # + # XXX: we cannot use `github.sha` as a unique identifier because + # pushing a tag may cancel a run that works on a branch push + # event. + group: ${{ startsWith(github.ref, 'refs/heads/tarantool/') + && format('{0}-{1}', github.run_id, github.run_attempt) + || format('{0}-{1}', github.workflow, github.ref) }} + cancel-in-progress: true + +jobs: + performance-luajit: + # The 'performance' label _must_ be set only for the single + # runner to guarantee that results are not dependent on the + # machine. + runs-on: + - self-hosted + - Linux + - x86_64 + - 'performance' + + env: + PERF_BRANCH: ${{ github.ref_name }} + PERF_COMMIT: ${{ github.sha }} + + strategy: + fail-fast: false + matrix: + GC64: [ON, OFF] + JOFF: [ON, OFF] + # Run each job sequentially. + max-parallel: 1 + name: > + LuaJIT + GC64:${{ matrix.GC64 }} + JOFF:${{ matrix.GC64 }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + - name: setup performance environment + uses: ./.github/actions/setup-performance + - name: configure + # The taskset alone will pin all the process threads + # into a single (random) isolated CPU, see + # https://bugzilla.kernel.org/show_bug.cgi?id=116701. + # The workaround is using realtime scheduler for the + # isolated task using chrt, e. g.: + # sudo taskset 0xef chrt 50. + # But this makes the process use non-standard, real-time + # round-robin scheduling mechanism. + run: > + cmake -S . -B ${{ env.BUILDDIR }} + -DCMAKE_BUILD_TYPE=RelWithDebInfo + -DLUAJIT_ENABLE_PERF=ON + -DLUAJIT_BENCH_INIT="taskset 0xfe chrt 50" + -DLUAJIT_DISABLE_JIT=${{ matrix.JOFF }} + -DLUAJIT_ENABLE_GC64=${{ matrix.GC64 }} + - name: build + run: cmake --build . --parallel + working-directory: ${{ env.BUILDDIR }} + - name: perf + run: make LuaJIT-perf + working-directory: ${{ env.BUILDDIR }} + - name: aggregate benchmark results + run: make LuaJIT-perf-aggregate + working-directory: ${{ env.BUILDDIR }} + - name: send statistics to InfluxDB + # --silent -o /dev/null: Prevent dumping any reply part + # in the output in case of an error. + # --fail: Exit with the 22 error code is status >= 400. + # --write-out: See the reason for the failure, if any. + # --retry, --retry-delay: To avoid losing the results of + # running after such a long job, try to retry sending the + # results. + run: > + curl --request POST + "${{ secrets.INFLUXDB_URL }}/api/v2/write?org=tarantool&bucket=luajit-performance&precision=s" + --write-out "%{http_code}" + --retry 5 + --retry-delay 5 + --connect-timeout 120 + --fail --silent -o /dev/null + --header "Authorization: Token ${{ secrets.INFLUXDB_TOKEN }}" + --data-binary @./perf/output/summary.txt + working-directory: ${{ env.BUILDDIR }} -- 2.51.0