https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104361

            Bug ID: 104361
           Summary: Biased Reference Counting for the standard library
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: antoshkka at gmail dot com
  Target Milestone: ---

There's a research named "Biased Reference Counting: Minimizing Atomic
Operations in Garbage Collection" that shows how to speed up reference counting
for some platforms for more than 20%
https://dl.acm.org/doi/pdf/10.1145/3243176.3243195 . 

The research does not talk about speedup of C++ but it is based on an
observation that most objects are only accessed by a single thread, which
allows most RC operations to be performed non-atomically. That observation fits
std::shared_ptr usage patterns.

Such a change seems to be an ABI break for shared_ptr, however may be it could
be used for stop_token and other new reference counted types.

Reply via email to