Closed serprex closed 8 years ago
Before we merge it, I'd like to see an benchmark where multiple threads stress the time handling – I have a hunch that the thread-local implementation will be faster in that case because it avoids synchronization (which can become a bottleneck).
Note that we are usually interested in the performance of the highly-contended hot areas of the code, so anything that synchronizes them in any way should be avoided.
This PR doesn't implement a shared epoch currently. Should I take your desire for a contended epoch benchmark to imply that this PR should implement a shared epoch?
@Tomaka's clock ticks library already uses std::time under the hood, so I'll merge this now and the conversation about synchronization can continue.
@llogiq Where are you seeing synchronization?
Instant is currently grabbed in thread_local init of Library. If it's desirable to share Instant then a write-once read-many global could be used for the epoch
Developing through github, feel free to squash