RefPtr
locking shows up near the top in a lot of our profiles.
It's extremely visible for any code that does quick_sort
on anything containing String
s where each swap
ends up doing three PtrTraits::exchange()
.
Such sorting accounts for ~55% of CrashReporter
runtime according to some local profiling.
We need a way to reduce the impact of thread-safe ref-counting on code that doesn't even run in a multi-threaded context.
One basic idea would be to have RefCounted
and ThreadUnsafeRefcounted
, String
and ThreadUnsafeString
etc. And then performance-sensitive single-threaded code could opt in to non-atomic reference counting.
Suggestions welcome!
cc @tomuta
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too