You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "dqhl76 (via GitHub)" <gi...@apache.org> on 2024/11/04 10:14:03 UTC

[PR] chore: add codspeed for benchmark [opendal]

dqhl76 opened a new pull request, #5280:
URL: https://github.com/apache/opendal/pull/5280

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes https://github.com/apache/opendal/issues/4937 .
   
   # Rationale for this change
   
   <!--
   Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   A new workflow that runs on every PR and the default main branch.
   The criterion dependency is changed to codspeed-criterion-compat.
   This should not affect cargo bench
   
   
   
   # Are there any user-facing changes?
   
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking-changes` label.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: add codspeed for benchmark [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #5280:
URL: https://github.com/apache/opendal/pull/5280#discussion_r1827560603


##########
.github/workflows/test_benchmark.yml:
##########
@@ -0,0 +1,70 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Benchmark Test
+
+on:
+  push:
+    branches:
+      - main
+  pull_request:
+    branches:
+      - main
+    paths:
+      - "core/src/**"
+      - "core/benches/**"
+      - "!core/src/docs/**"
+      - ".github/workflows/test_benchmark.yml"
+  # `workflow_dispatch` is needed by codspeed for first time trigger
+  workflow_dispatch:
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
+  cancel-in-progress: true
+
+jobs:
+  benchmark:

Review Comment:
   We should skip benchmark if this PR is from forked repo.



##########
.github/workflows/test_benchmark.yml:
##########
@@ -0,0 +1,70 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Benchmark Test
+
+on:
+  push:
+    branches:
+      - main
+  pull_request:
+    branches:
+      - main
+    paths:
+      - "core/src/**"
+      - "core/benches/**"
+      - "!core/src/docs/**"
+      - ".github/workflows/test_benchmark.yml"
+  # `workflow_dispatch` is needed by codspeed for first time trigger
+  workflow_dispatch:
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
+  cancel-in-progress: true
+
+jobs:
+  benchmark:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - name: Setup Rust toolchain
+        uses: ./.github/actions/setup
+      - uses: 1password/load-secrets-action/configure@v1
+        with:
+          connect-host: ${{ secrets.OP_CONNECT_HOST }}
+          connect-token: ${{ secrets.OP_CONNECT_TOKEN }}
+      - uses: 1password/load-secrets-action@v1
+        with:
+          export-env: true
+        env:
+          CODSPEED_TOKEN: op://services/codspeed/token
+      - name: Setup codspeed
+        run: cargo install cargo-codspeed
+      - name: Setup Memory env
+        uses: ./.github/services/memory/memory
+      - name: Install codpseed-criterion-compat
+        working-directory: core
+        run: cargo add --dev --rename criterion --features async,async_tokio codspeed-criterion-compat@2.7.2
+      - name: Build the benchmark targets
+        working-directory: core
+        run: cargo codspeed build --features tests
+      - name: Run the benchmarks
+        uses: CodSpeedHQ/action@v3
+        with:

Review Comment:
   We should set `OPENDAL_TEST=memory` here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: add codspeed for benchmark [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #5280:
URL: https://github.com/apache/opendal/pull/5280#issuecomment-2454432036

   The benchmark is identified by name, and we can expand it to support various services. We can implement this in future PRs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: add codspeed for benchmark [opendal]

Posted by "dqhl76 (via GitHub)" <gi...@apache.org>.
dqhl76 commented on PR #5280:
URL: https://github.com/apache/opendal/pull/5280#issuecomment-2454523480

   Hi @Xuanwo, All comments are applied, could you please take a look again? Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: add codspeed for benchmark [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #5280:
URL: https://github.com/apache/opendal/pull/5280


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: add codspeed for benchmark [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #5280:
URL: https://github.com/apache/opendal/pull/5280#discussion_r1827511308


##########
.github/workflows/test_benchmark.yml:
##########
@@ -0,0 +1,67 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Benchmark Test
+
+on:
+  push:
+    branches:
+      - main
+  pull_request:
+    branches:
+      - main
+    paths:
+      - "core/src/**"
+      - "core/benches/**"
+      - "!core/src/docs/**"
+      - ".github/workflows/test_benchmark.yml"
+  # `workflow_dispatch` is needed by codspeed for first time trigger
+  workflow_dispatch:
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
+  cancel-in-progress: true
+
+jobs:
+  benchmark:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - name: Setup Rust toolchain
+        uses: ./.github/actions/setup
+      - uses: 1password/load-secrets-action/configure@v1
+        with:
+          connect-host: ${{ secrets.OP_CONNECT_HOST }}
+          connect-token: ${{ secrets.OP_CONNECT_TOKEN }}
+      - uses: 1password/load-secrets-action@v1
+        with:
+          export-env: true
+        env:
+          CODSPEED_TOKEN: op://services/benchmark/codspeed

Review Comment:
   ```suggestion
             CODSPEED_TOKEN: op://services/codspeed/token
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: add codspeed for benchmark [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #5280:
URL: https://github.com/apache/opendal/pull/5280#discussion_r1827770192


##########
.github/workflows/test_benchmark.yml:
##########
@@ -0,0 +1,73 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Benchmark Test
+
+on:
+  push:
+    branches:
+      - main
+  pull_request:
+    branches:
+      - main
+    paths:
+      - "core/src/**"
+      - "core/benches/**"
+      - "!core/src/docs/**"
+      - ".github/workflows/test_benchmark.yml"
+  # `workflow_dispatch` is needed by codspeed for first time trigger
+  workflow_dispatch:
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
+  cancel-in-progress: true
+
+jobs:
+  benchmark:
+    runs-on: ubuntu-latest
+    if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
+    steps:
+      - uses: actions/checkout@v4
+      - name: Setup Rust toolchain
+        uses: ./.github/actions/setup
+      - uses: 1password/load-secrets-action/configure@v1
+        with:
+          connect-host: ${{ secrets.OP_CONNECT_HOST }}
+          connect-token: ${{ secrets.OP_CONNECT_TOKEN }}
+      - uses: 1password/load-secrets-action@v1
+        with:
+          export-env: true
+        env:
+          CODSPEED_TOKEN: op://services/codspeed/token
+      - name: Setup codspeed
+        run: cargo install cargo-codspeed
+      - name: Setup Memory env
+        uses: ./.github/services/memory/memory
+      - name: Install codpseed-criterion-compat
+        working-directory: core
+        run: cargo add --dev --rename criterion --features async,async_tokio codspeed-criterion-compat@2.7.2
+      - name: Build the benchmark targets
+        working-directory: core
+        run: cargo codspeed build --features tests
+        env:
+          OPENDAL_TEST: memory
+      - name: Run the benchmarks
+        uses: CodSpeedHQ/action@v3
+        with:
+          working-directory: core
+          run: cargo codspeed run
+          token: ${{ env.CODSPEED_TOKEN }}

Review Comment:
   ```suggestion
         - name: Build the benchmark targets
           working-directory: core
           run: cargo codspeed build --features tests,services-memory
         - name: Run the benchmarks
           uses: CodSpeedHQ/action@v3
           env:
             OPENDAL_TEST: memory
           with:
             working-directory: core
             run: cargo codspeed run
             token: ${{ env.CODSPEED_TOKEN }}
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: add codspeed for benchmark [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #5280:
URL: https://github.com/apache/opendal/pull/5280#issuecomment-2454344553

   Hi, @dqhl76, token has been created at `op://services/codspeed/token`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: add codspeed for benchmark [opendal]

Posted by "codspeed-hq[bot] (via GitHub)" <gi...@apache.org>.
codspeed-hq[bot] commented on PR #5280:
URL: https://github.com/apache/opendal/pull/5280#issuecomment-2454415907

   ## [CodSpeed Performance Report](https://codspeed.io/apache/opendal/branches/benchmark-ci)
   
   
   ### Congrats! CodSpeed is installed 🎉
   
   `🆕` **41 new benchmarks were detected.**
   
   You will start to see performance impacts in the reports once the benchmarks are run from your default branch.
   
   <details>
     <summary><h3>Detected benchmarks</h3></summary>
   
   - `buffer 256 KiB * 32 advance` (602.2 ns)
   - `buffer 256 KiB * 32 chunk` (154.4 ns)
   - `buffer 256 KiB * 32 truncate` (375.3 ns)
   - `buffer 256 KiB * 4 advance` (602.2 ns)
   - `buffer 256 KiB * 4 chunk` (125.3 ns)
   - `buffer 256 KiB * 4 truncate` (375.3 ns)
   - `buffer 4.00 MiB * 32 advance` (602.2 ns)
   - `buffer 4.00 MiB * 32 chunk` (125.3 ns)
   - `buffer 4.00 MiB * 32 truncate` (375.3 ns)
   - `buffer 4.00 MiB * 4 advance` (602.2 ns)
   - `buffer 4.00 MiB * 4 chunk` (125.3 ns)
   - `buffer 4.00 MiB * 4 truncate` (375.3 ns)
   - `bytes buf 256 KiB * 32  advance` (435 ns)
   - `bytes buf 256 KiB * 32  chunk` (0 s)
   - `bytes buf 256 KiB * 32  truncate` (494.4 ns)
   - `bytes buf 256 KiB * 4  advance` (435 ns)
   - `bytes buf 256 KiB * 4  chunk` (0 s)
   - `bytes buf 256 KiB * 4  truncate` (494.4 ns)
   - `bytes buf 4.00 MiB * 32  advance` (435 ns)
   - `bytes buf 4.00 MiB * 32  chunk` (0 s)
   - `bytes buf 4.00 MiB * 32  truncate` (494.4 ns)
   - `bytes buf 4.00 MiB * 4  advance` (435 ns)
   - `bytes buf 4.00 MiB * 4  chunk` (0 s)
   - `bytes buf 4.00 MiB * 4  truncate` (494.4 ns)
   - `256 KiB * 1000k advance` (17.4 ms)
   - `256 KiB * 1000k chunk` (154.4 ns)
   - `256 KiB * 1000k truncate` (245.8 ns)
   - `256 KiB * 100k advance` (1.7 ms)
   - `256 KiB * 100k chunk` (154.4 ns)
   - `256 KiB * 100k truncate` (245.8 ns)
   - `256 KiB * 10k advance` (174.1 µs)
   - `256 KiB * 10k chunk` (183.6 ns)
   - `256 KiB * 10k truncate` (245.8 ns)
   - `256 KiB * 1k advance` (17.9 µs)
   - `256 KiB * 1k chunk` (154.4 ns)
   - `256 KiB * 1k truncate` (245.8 ns)
   - `1` (270.7 µs)
   - `16` (331.1 µs)
   - `2` (534.1 µs)
   - `4` (420.7 µs)
   - `8` (362 µs)
   
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org