Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CodSpeed

on:
push:
branches: [ dev ]

pull_request:

# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:

jobs:
benchmarks:
name: Run benchmarks
runs-on: ubuntu-24.04
steps:
- name: Checkout ArkScript
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup compilers and tools
shell: bash
run: |
sudo apt-get install -y clang-16 lld-16 libc++-16-dev libc++abi-16-dev clang-tools-16

- name: Build the benchmark target
run: |
cmake -Bbuild \
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCODSPEED_MODE=instrumentation \
-DARK_BENCHMARKS=On -DARK_BENCHMARKS_CODSPEED=On \
-DCMAKE_C_COMPILER=clang-16 -DCMAKE_CXX_COMPILER=clang++-16 \
-DARK_SANITIZERS=Off -DARK_BUILD_EXE=Off -DARK_BUILD_MODULES=Off \
-DARK_UNITY_BUILD=On
cmake --build build --config RelWithDebInfo -- -j 4

- name: Run the benchmarks
uses: CodSpeedHQ/action@0010eb0ca6e89b80c88e8edaaa07cfe5f3e6664d # v3.5.0
with:
run: ./build/bench
token: ${{ secrets.CODSPEED_TOKEN }}
15 changes: 13 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG OR APPLE)
-Wall -Wextra -pedantic -Wstrict-aliasing
-Wshadow
-Wconversion
-Werror
# Allow deprecation warnings to not be treated as errors
-Wno-error=deprecated-declarations
# We use pragmas to disable warnings we understand.
Expand All @@ -82,6 +81,10 @@ if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG OR APPLE)
-fvisibility=hidden
-fno-semantic-interposition
)
if (NOT ARK_BENCHMARKS)
target_compile_options(ArkReactor PUBLIC -Werror)
endif()

# set fmtlib visibility to default
target_compile_definitions(ArkReactor PUBLIC FMT_SHARED)

Expand Down Expand Up @@ -243,7 +246,15 @@ endif ()
if (ARK_BENCHMARKS)
set(BENCHMARK_ENABLE_GTEST_TESTS Off)
set(BENCHMARK_ENABLE_TESTING Off)
CPMAddPackage("gh:google/benchmark@1.8.3")

if (ARK_BENCHMARKS_CODSPEED)
set(BENCHMARK_DOWNLOAD_DEPENDENCIES ON)
CPMAddPackage(
URI "gh:CodSpeedHQ/codspeed-cpp#5324618a1a14e0aa9a99dcfb467b9c2a57957e19@1.1.1"
SOURCE_SUBDIR google_benchmark)
else()
CPMAddPackage("gh:google/benchmark@1.8.3")
endif ()

add_executable(bench tests/benchmarks/main.cpp)
target_link_libraries(bench PUBLIC ArkReactor benchmark::benchmark)
Expand Down
Loading