shared_ptr optimization with local and global counters
- Dominant language
- C++
- Stars
- 111
- Forks
- 116
- PR merge metrics
- No merged PRs in 30d
Description
Would it be desirable to have a `shared_ptr` (or extend the existing `shared_ptr`) with a thread-local reference counter?
The basic idea is to have two reference counters: the normal reference counter is changed to count the number of threads using the `shared_ptr`, and an additional thread-local reference counter is used when a thread copies/deletes the `shared_ptr` (like `local_shared_ptr`.)
This ought to yield better performance in multi-threaded applications as it reduces the amount of cache congestion on the normal reference counter.
The disadvantages is the increased size due to the extra counter, and we need to consider how to pass `shared_ptr` between threads.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.