New Features π
- Added facilities for shared/weak ownership by @mingxwa in #264:
- function template
make_proxy_shared
: Similar to instantiating aproxy
withstd::shared_ptr
, but- Without additional type-erasure on the deleter,
- Having a more compact memory layout without requiring a separate control block,
- Without weak ownership support if not desired.
- function template
allocate_proxy_shared
: Similar tomake_proxy_shared()
while supports any custom allocators. - alias template
weak_proxy
and class templateweak_facade
: Specifyproxy
with weak ownership. basic_facade_builder::support_weak
: Specifies that afacade
typeF
supports conversion fromproxy<F>
toweak_proxy<F>
.
- function template
- function template
make_proxy_view
by @mingxwa in #265: Similar to creating aproxy_view
from a raw pointer, but honors constness and reference semantics. - concept
proxiable_target
by @mingxwa in #265: Specifies that a reference type can instantiate aproxy_view
.
Quality Improvements π¬
- Improved diagnostics by reducing constraints by @mingxwa in #262. Thanks to @SidneyCogdill for the great idea!
- Allowed creating
proxy
from a null pointer by @mingxwa in #260 - Prefered static
operator()
if available by @mingxwa in #267 - Constrained
proxy
withfacade
by @mingxwa in #263 - Switched lifetime convention to standard dispatch model by @mingxwa in #269
- Aligned behavior of direct and indirect
proxy_invoke
with rvalue reference by @mingxwa in #271
Toolchain Updates π οΈ
- Added benchmarks for shared ownership both in indirect invocation and lifetime management by @mingxwa in #264. Below are the numbers from a recent CI build:
MSVC on Windows | GCC on Ubuntu | Clang on Ubuntu | Apple Clang on macOS | NVIDIA HPC on Ubuntu | |
---|---|---|---|---|---|
Indirect invocation on small objects via proxy vs. virtual functions (shared ownership) |
π’proxy is about 327.6% faster |
π’proxy is about 83.2% faster |
π’proxy is about 46.1% faster |
π’proxy is about 26.8% faster |
π’proxy is about 75.5% faster |
Indirect invocation on large objects via proxy vs. virtual functions (shared ownership) |
π’proxy is about 165.3% faster |
π’proxy is about 28.4% faster |
π’proxy is about 20.8% faster |
π΄proxy is about 5.1% slower |
π’proxy is about 8.6% faster |
Basic lifetime management for small objects with proxy (shared ownership) vs. std::shared_ptr (both without memory pool) |
π’proxy is about 11.8% faster |
π’proxy is about 10.8% faster |
π’proxy is about 8.5% faster |
π’proxy is about 37.5% faster |
π’proxy is about 8.8% faster |
Basic lifetime management for small objects with proxy (shared ownership) vs. std::shared_ptr (both with memory pool) |
π’proxy is about 5.7% faster |
π‘proxy is about 4.0% faster |
π’proxy is about 21.5% faster |
π’proxy is about 30.5% faster |
π‘proxy is about 1.6% faster |
Basic lifetime management for large objects with proxy (shared ownership) vs. std::shared_ptr (both without memory pool) |
π’proxy is about 21.1% faster |
π’proxy is about 6.0% faster |
π‘proxy is about 0.4% slower |
π’proxy is about 48.9% faster |
π’proxy is about 8.7% faster |
Basic lifetime management for large objects with proxy (shared ownership) vs. std::shared_ptr (both with memory pool) |
π’proxy is about 17.7% faster |
π’proxy is about 11.2% faster |
π’proxy is about 29.1% faster |
π’proxy is about 10.5% faster |
π‘proxy is about 4.5% faster |
- Attached environment information to benchmarking report by @mingxwa in #270
- Revised documentation for 3.3.0 by @mingxwa in #272
Full Changelog: 3.2.1...3.3.0