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
benchmarksto benchmark the library in various scenarios.proxyand virtual functions on small/large objects.proxy,std::unique_ptr,std::shared_ptrandstd::anyfor small/large objects.Observed from the CI build:
proxyvs. virtual functionsproxyis about 254.1% fasterproxyis about 31.8% fasterproxyis about 38.0% fasterproxyis about 3.5% fasterproxyvs. virtual functionsproxyis about 269.9% fasterproxyis about 28.3% fasterproxyis about 17.4% fasterproxyis about 2.5% fasterproxyvs.std::unique_ptrproxyis about 375.4% fasterproxyis about 369.8% fasterproxyis about 347.1% fasterproxyis about 254.6% fasterproxyvs.std::shared_ptr(without memory pool)proxyis about 494.4% fasterproxyis about 894.4% fasterproxyis about 847.2% fasterproxyis about 355.6% fasterproxyvs.std::shared_ptr(with memory pool)proxyis about 246.5% fasterproxyis about 589.5% fasterproxyis about 566.0% fasterproxyis about 157.3% fasterproxyvs.std::anyproxyis about 61.6% fasterproxyis about 235.7% fasterproxyis about 222.5% fasterproxyis about 20.0% fasterproxy(without memory pool) vs.std::unique_ptrproxyis about 0.5% slowerproxyis about 2.7% slowerproxyis about 7.4% fasterproxyis about 8.0% slowerproxy(with memory pool) vs.std::unique_ptrproxyis about 117.4% fasterproxyis about 113.6% fasterproxyis about 161.1% fasterproxyis about 88.5% fasterproxyvs.std::shared_ptr(both without memory pool)proxyis about 12.1% fasterproxyis about 5.9% fasterproxyis about 16.0% fasterproxyis about 11.5% fasterproxyvs.std::shared_ptr(both with memory pool)proxyis about 8.7% fasterproxyis about 16.4% fasterproxyis about 8.6% fasterproxyis about 46.8% fasterproxy(without memory pool) vs.std::anyproxyis about 33.6% fasterproxyis about 6.2% slowerproxyis about 5.5% fasterproxyis about 3.7% fasterproxy(with memory pool) vs.std::anyproxyis about 192.1% fasterproxyis about 105.9% fasterproxyis about 156.4% fasterproxyis about 112.5% fasterNotes
intfield.void*) and a singleintfield.int,std::shared_ptr<int>andstd::unique_lock<std::mutex>.std::array<char, 100>,std::array<std::string, 3>andstd::unique_lock<std::mutex> padded with void*[15]are used as large object.std::pmr::unsynchronized_pool_resourceis used.