|
|
|
|
|
by gnulinux
931 days ago
|
|
The overhead of an uncontested lock is not much more than a memory operation but it allows you to be able to use the same code in threaded context in tokio async which is a huge benefit. Unless you need the optimization (i.e. you profiled and determined that Arc in a hot loop is slowing you down) I think it's fine to use Arc in general. |
|
An atomic memory operation! These can be orders of magnitude slower than regular memory operations.