Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
benchmark_min_warmup_time=0.1
to warmup each benchmark.benchmark_repetitions
from10
to30
to get more test results.--benchmark_min_time=0.1s
to keep the overall execution time similar with before.benchmark_enable_random_interleaving=true
to avoid transient high load.BM_SmallObjectInvocationViaProxy
,BM_SmallObjectInvocationViaVirtualFunction
,BM_LargeObjectInvocationViaProxy
andBM_LargeObjectInvocationViaVirtualFunction
, moved data preparation from global to each function body to make sure each case runs from a clean state.15 * sizeof(void*)
into5 * sizeof(void*)
to have less effects on heap allocation.12,000
into30,000
for better differentiation.workflow_dispatch
for CI pipeline to facilitate benchmarking.Here's the report generated from the CI build of this PR.
Benchmarking Report
proxy
vs. virtual functionsproxy
is about 233.7% fasterproxy
is about 39.5% fasterproxy
is about 44.7% fasterproxy
is about 6.7% fasterproxy
vs. virtual functionsproxy
is about 173.2% fasterproxy
is about 16.2% fasterproxy
is about 14.8% fasterproxy
is about 10.2% fasterproxy
vs.std::unique_ptr
proxy
is about 439.1% fasterproxy
is about 87.2% fasterproxy
is about 378.3% fasterproxy
is about 302.0% fasterproxy
vs.std::shared_ptr
(without memory pool)proxy
is about 672.9% fasterproxy
is about 115.4% fasterproxy
is about 492.3% fasterproxy
is about 438.8% fasterproxy
vs.std::shared_ptr
(with memory pool)proxy
is about 187.4% fasterproxy
is about 181.4% fasterproxy
is about 652.7% fasterproxy
is about 156.1% fasterproxy
vs.std::any
proxy
is about 56.2% fasterproxy
is about 47.7% fasterproxy
is about 323.8% fasterproxy
is about 14.1% fasterproxy
(without memory pool) vs.std::unique_ptr
proxy
is about 18.7% fasterproxy
is about 8.1% fasterproxy
is about 11.7% fasterproxy
is about 5.6% slowerproxy
(with memory pool) vs.std::unique_ptr
proxy
is about 265.8% fasterproxy
is about 90.7% fasterproxy
is about 130.8% fasterproxy
is about 93.1% fasterproxy
vs.std::shared_ptr
(both without memory pool)proxy
is about 34.1% fasterproxy
is about 5.3% fasterproxy
is about 7.6% fasterproxy
is about 5.6% fasterproxy
vs.std::shared_ptr
(both with memory pool)proxy
is about 8.9% fasterproxy
is about 9.4% fasterproxy
is about 16.7% fasterproxy
is about 42.9% fasterproxy
(without memory pool) vs.std::any
proxy
is about 15.3% fasterproxy
is about 3.1% slowerproxy
is about 1.0% fasterproxy
is about 5.9% fasterproxy
(with memory pool) vs.std::any
proxy
is about 255.5% fasterproxy
is about 71.0% fasterproxy
is about 108.6% fasterproxy
is about 116.5% faster