masaori335 commented on PR #9168: URL: https://github.com/apache/trafficserver/pull/9168#issuecomment-1308001127
1. `ink_get_hrtime_internal` vs `std::chrono::system_clock::now` My very basic benchmark says `ink_get_hrtime_internal` (20ns) is slightly faster than `std::chrono::system_clock::now` (24ns). https://gist.github.com/masaori335/82472e4ba471591edbc5e760db34631f Anyway, both of them need around 20ns. It still makes sense to have a cache for frequent access. 2. std::atomic vs thread local Performance perspective, thread local seems better (#9184) because it shares nothing. A concern is it requires every thread to update the `cur_time` periodically by itself, but some threads assume it's updated by another thread with current code - e.g. an issue was found on `LOG_FLUSH` thread. ( #9184 fixes this too ) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
