Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch benchmarks to modules #666

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ jobs:
with:
build-dir: ${{ runner.workspace }}/build
build-type: Debug
cc: clang
cxx: clang++
configure-options:
-DBUILD_SHARED_LIBS=${{ matrix.shared }}
-DCMAKE_C_COMPILER_LAUNCHER=ccache
Expand All @@ -94,6 +96,7 @@ jobs:
-DCMAKE_CXX_FLAGS=--coverage
-DCMAKE_SHARED_LINKER_FLAGS=--coverage
-DCMAKE_EXE_LINKER_FLAGS=--coverage
-G Ninja
run-test: true
ctest-options:
--output-on-failure
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
fail-fast: false
matrix:
compiler:
- { compiler: GNU, CC: gcc, CXX: g++ }
- { compiler: LLVM, CC: clang-16, CXX: clang++-16 }
# - { compiler: GNU, CC: gcc-14, CXX: g++-14 }
- { compiler: LLVM, CC: clang, CXX: clang++ }
build: [Release]
shared: [TRUE, FALSE]
os: [ubuntu-24.04]
Expand Down Expand Up @@ -99,6 +99,7 @@ jobs:
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DENABLE_SANITIZERS_FOR_TESTS=${{ env.ENABLE_SANITIZERS }}
-DPython=/usr/bin/python3
-G Ninja
run-test: true
ctest-options:
-LE HeavyData
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/macos-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
brew link --overwrite pkgconf
brew install \
llvm \
ninja \
dlib \
exiv2 \
opencv \
Expand All @@ -48,6 +49,9 @@ jobs:
with:
build-dir: ${{ runner.workspace }}/build
build-type: Release
configure-options: -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON
configure-options:
-DBUILD_TESTING=OFF
-DBUILD_SHARED_LIBS=ON
-G Ninja
env:
VERBOSE: 1
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cmake_minimum_required(VERSION 3.25)
cmake_minimum_required(VERSION 3.28)
project(PhotoBroom VERSION 1.7.0 LANGUAGES CXX)

if(POLICY CMP0140)
Expand Down Expand Up @@ -28,7 +28,7 @@ set(CMAKE_MODULE_PATH

set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 23)

set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
Expand Down
9 changes: 8 additions & 1 deletion src/database/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@

add_executable(backends_benchmark
add_executable(backends_benchmark)

target_sources(backends_benchmark
PUBLIC
main.cpp
)

target_sources(backends_benchmark
PUBLIC FILE_SET CXX_MODULES FILES
photo_fetch_benchmarks.cpp
)

Expand Down
4 changes: 1 addition & 3 deletions src/database/benchmarks/main.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@

#include <QCoreApplication>

void BM_get_photo_delta();
void BM_fetch_photo_delta();

import photoDeltaFetchingBenchmarks;

int main(int argc, char** argv)
{
Expand Down
8 changes: 6 additions & 2 deletions src/database/benchmarks/photo_fetch_benchmarks.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

module;

#include <QDir>
#include <QTime>
#include <QTemporaryDir>
Expand All @@ -12,6 +14,8 @@

#include <unit_tests_utils/empty_logger.hpp>

export module photoDeltaFetchingBenchmarks;

namespace
{
void fillBackendWithData(Database::IBackend& backend)
Expand Down Expand Up @@ -99,7 +103,7 @@ namespace
}


void BM_get_photo_delta()
export void BM_get_photo_delta()
{
for_each_backend(fillBackendWithData, [](Database::IBackend& backend)
{
Expand All @@ -116,7 +120,7 @@ void BM_get_photo_delta()
}


void BM_fetch_photo_delta()
export void BM_fetch_photo_delta()
{
for_each_backend(fillBackendWithData, [](Database::IBackend& backend)
{
Expand Down
Loading