Skip to content
This repository was archived by the owner on Jan 29, 2026. It is now read-only.
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
2 changes: 1 addition & 1 deletion .github/workflows/bvt-appleclang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: run benchmarks
run: |
cd build/benchmarks
./msft_proxy_benchmarks --benchmark_repetitions=10 --benchmark_report_aggregates_only=true --benchmark_enable_random_interleaving=true --benchmark_out=benchmarking-results.json
./msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > benchmarking-results.json

- name: archive benchmarking results
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bvt-clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: run benchmarks
run: |
cd build-clang-18/benchmarks
./msft_proxy_benchmarks --benchmark_repetitions=10 --benchmark_report_aggregates_only=true --benchmark_enable_random_interleaving=true --benchmark_out=benchmarking-results.json
./msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > benchmarking-results.json

- name: archive benchmarking results
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bvt-gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: run benchmarks
run: |
cd build-gcc-14/benchmarks
./msft_proxy_benchmarks --benchmark_repetitions=10 --benchmark_report_aggregates_only=true --benchmark_enable_random_interleaving=true --benchmark_out=benchmarking-results.json
./msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > benchmarking-results.json

- name: archive benchmarking results
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bvt-msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: run benchmarks
run: |
cd build\benchmarks
.\Release\msft_proxy_benchmarks.exe --benchmark_repetitions=10 --benchmark_report_aggregates_only=true --benchmark_enable_random_interleaving=true --benchmark_out=benchmarking-results.json
.\Release\msft_proxy_benchmarks.exe --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > benchmarking-results.json

- name: archive benchmarking results
uses: actions/upload-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pipeline-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [ main, release/** ]
pull_request:
branches: [ main, release/** ]
workflow_dispatch:

jobs:
run-bvt-gcc:
Expand Down
16 changes: 12 additions & 4 deletions benchmarks/proxy_invocation_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,42 @@

#include "proxy_invocation_benchmark_context.h"

namespace {

void BM_SmallObjectInvocationViaProxy(benchmark::State& state) {
auto data = GenerateSmallObjectInvocationProxyTestData();
for (auto _ : state) {
for (auto& p : SmallObjectInvocationProxyTestData) {
for (auto& p : data) {
int result = p->Fun();
benchmark::DoNotOptimize(result);
}
}
}

void BM_SmallObjectInvocationViaVirtualFunction(benchmark::State& state) {
auto data = GenerateSmallObjectInvocationVirtualFunctionTestData();
for (auto _ : state) {
for (auto& p : SmallObjectInvocationVirtualFunctionTestData) {
for (auto& p : data) {
int result = p->Fun();
benchmark::DoNotOptimize(result);
}
}
}

void BM_LargeObjectInvocationViaProxy(benchmark::State& state) {
auto data = GenerateLargeObjectInvocationProxyTestData();
for (auto _ : state) {
for (auto& p : LargeObjectInvocationProxyTestData) {
for (auto& p : data) {
int result = p->Fun();
benchmark::DoNotOptimize(result);
}
}
}

void BM_LargeObjectInvocationViaVirtualFunction(benchmark::State& state) {
auto data = GenerateLargeObjectInvocationVirtualFunctionTestData();
for (auto _ : state) {
for (auto& p : LargeObjectInvocationVirtualFunctionTestData) {
for (auto& p : data) {
int result = p->Fun();
benchmark::DoNotOptimize(result);
}
Expand All @@ -45,3 +51,5 @@ BENCHMARK(BM_SmallObjectInvocationViaProxy);
BENCHMARK(BM_SmallObjectInvocationViaVirtualFunction);
BENCHMARK(BM_LargeObjectInvocationViaProxy);
BENCHMARK(BM_LargeObjectInvocationViaVirtualFunction);

} // namespace
35 changes: 18 additions & 17 deletions benchmarks/proxy_invocation_benchmark_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class NonIntrusiveLargeImpl {
int Fun() const noexcept { return seed_ ^ (TypeSeries + 1); }

private:
void* padding_[15]{};
void* padding_[5]{};
int seed_;
};

Expand All @@ -50,7 +50,7 @@ class IntrusiveLargeImpl : public InvocationTestBase {
int Fun() const noexcept override { return seed_ ^ (TypeSeries + 1); }

private:
void* padding_[16]{};
void* padding_[5]{};
int seed_;
};

Expand All @@ -76,18 +76,19 @@ auto GenerateTestData(const F& generator) {

} // namespace

const std::vector<pro::proxy<InvocationTestFacade>> SmallObjectInvocationProxyTestData = GenerateTestData(
[]<int TypeSeries>(IntConstant<TypeSeries>, int seed)
{ return pro::make_proxy<InvocationTestFacade, NonIntrusiveSmallImpl<TypeSeries>>(seed); });

const std::vector<std::unique_ptr<InvocationTestBase>> SmallObjectInvocationVirtualFunctionTestData = GenerateTestData(
[]<int TypeSeries>(IntConstant<TypeSeries>, int seed)
{ return std::unique_ptr<InvocationTestBase>{new IntrusiveSmallImpl<TypeSeries>(seed)}; });

const std::vector<pro::proxy<InvocationTestFacade>> LargeObjectInvocationProxyTestData = GenerateTestData(
[]<int TypeSeries>(IntConstant<TypeSeries>, int seed)
{ return pro::make_proxy<InvocationTestFacade, NonIntrusiveLargeImpl<TypeSeries>>(seed); });

const std::vector<std::unique_ptr<InvocationTestBase>> LargeObjectInvocationVirtualFunctionTestData = GenerateTestData(
[]<int TypeSeries>(IntConstant<TypeSeries>, int seed)
{ return std::unique_ptr<InvocationTestBase>{new IntrusiveLargeImpl<TypeSeries>(seed)}; });
std::vector<pro::proxy<InvocationTestFacade>> GenerateSmallObjectInvocationProxyTestData() {
return GenerateTestData([]<int TypeSeries>(IntConstant<TypeSeries>, int seed)
{ return pro::make_proxy<InvocationTestFacade, NonIntrusiveSmallImpl<TypeSeries>>(seed); });
}
std::vector<std::unique_ptr<InvocationTestBase>> GenerateSmallObjectInvocationVirtualFunctionTestData() {
return GenerateTestData([]<int TypeSeries>(IntConstant<TypeSeries>, int seed)
{ return std::unique_ptr<InvocationTestBase>{new IntrusiveSmallImpl<TypeSeries>(seed)}; });
}
std::vector<pro::proxy<InvocationTestFacade>> GenerateLargeObjectInvocationProxyTestData() {
return GenerateTestData([]<int TypeSeries>(IntConstant<TypeSeries>, int seed)
{ return pro::make_proxy<InvocationTestFacade, NonIntrusiveLargeImpl<TypeSeries>>(seed); });
}
std::vector<std::unique_ptr<InvocationTestBase>> GenerateLargeObjectInvocationVirtualFunctionTestData() {
return GenerateTestData([]<int TypeSeries>(IntConstant<TypeSeries>, int seed)
{ return std::unique_ptr<InvocationTestBase>{new IntrusiveLargeImpl<TypeSeries>(seed)}; });
}
8 changes: 4 additions & 4 deletions benchmarks/proxy_invocation_benchmark_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct InvocationTestBase {
virtual ~InvocationTestBase() = default;
};

extern const std::vector<pro::proxy<InvocationTestFacade>> SmallObjectInvocationProxyTestData;
extern const std::vector<std::unique_ptr<InvocationTestBase>> SmallObjectInvocationVirtualFunctionTestData;
extern const std::vector<pro::proxy<InvocationTestFacade>> LargeObjectInvocationProxyTestData;
extern const std::vector<std::unique_ptr<InvocationTestBase>> LargeObjectInvocationVirtualFunctionTestData;
std::vector<pro::proxy<InvocationTestFacade>> GenerateSmallObjectInvocationProxyTestData();
std::vector<std::unique_ptr<InvocationTestBase>> GenerateSmallObjectInvocationVirtualFunctionTestData();
std::vector<pro::proxy<InvocationTestFacade>> GenerateLargeObjectInvocationProxyTestData();
std::vector<std::unique_ptr<InvocationTestBase>> GenerateLargeObjectInvocationVirtualFunctionTestData();
6 changes: 3 additions & 3 deletions benchmarks/proxy_management_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace {

constexpr int TestManagedObjectCount = 120000;
constexpr int TestManagedObjectCount = 600000;
constexpr int TypeSeriesCount = 3;

using SmallObject1 = int;
Expand Down Expand Up @@ -41,8 +41,6 @@ struct PolymorphicObject : PolymorphicObjectBase {
T Value;
};

} // namespace

struct DefaultFacade : pro::facade_builder
::support_copy<pro::constraint_level::nontrivial>
::build {};
Expand Down Expand Up @@ -207,3 +205,5 @@ BENCHMARK(BM_LargeObjectManagementWithUniquePtr);
BENCHMARK(BM_LargeObjectManagementWithSharedPtr);
BENCHMARK(BM_LargeObjectManagementWithSharedPtr_Pooled);
BENCHMARK(BM_LargeObjectManagementWithAny);

} // namespace