I am in a situation where, after analyzing and analyzing our system, I came to the conclusion that the logging component of the system is one of many bottle necks that occupy about 17% of the total working time - a lot of things are recorded.
At the same time, about 5% of the time spent by the journal is associated with creating a date / time stamp in ascii in the following format: YYYYMMDD HHMMSS.fff - we roughly write about 700 thousand lines per second. (approximately 700K x (localtime and gettimeofday) calls per second)
I was curious that those who use SOers to create temporary markers are effective.
Cross-platform solutions are welcome.
Note1: we looked at Boost.datetime - it's great, but too slow for our needs, std :: chrono is an ideal solution, however we, unfortunately, must support pre C ++ 11 compilers.
Note2: We implemented a simple optimization that calculates only a part of the date (yyyymmdd) in 24 hours and, therefore, has only 1 gettimeofday call in a row - it didn’t help much.
source
share