send_wrapper
send_wrapper copied to clipboard
Use thread local to cache current thread id
The calling to std::thread::current() clones an Arc. It is a bit heavy in a most likely single-threaded case. This PR caches the current thread id in a TLS. It should be faster than cloning an Arc.