News for hackers. Stuff that matters.
Re:NanoLog – a nanosecond scale logging system for C++ by dclusin on Sunday September 01, 2019 @07:05PM (#20855588)
I think what OP is hinting at here is cache invalidation/eviction caused by the additional thread's processing and memory operations. If your requirements are down to nanosecond granularities then cache misses are probably being measured and noticeable. A third party logging thread doing memory copies and other log processing sounds like a fine way to unintentionally evict a bunch of cache entries. You might be able to mitigate this to some extent with CPU affinities for threads I suppose. Another option would be to move logging to the network and record packets in/out with an out of band monitoring solution.
Re:NanoLog – a nanosecond scale logging system for C++ by Rapzid on Sunday September 01, 2019 @07:48PM (#20855723)
Logging the raw structured log entry and off-loading any string formatting to another system is a very interesting idea. Just push the whole "friendly message" stuff off to other logging infrastructure where the latencies matter less.
Re:NanoLog – a nanosecond scale logging system for C++ by paulddraper on Sunday September 01, 2019 @07:11PM (#20855603)
Well yes, using another thread is a only good idea if you have an extra core available.

L1 cache is per-core anyway, and I doubt L2 is going to hurt much.

Re:NanoLog – a nanosecond scale logging system for C++ by jnordwick on Sunday September 01, 2019 @07:55PM (#20855752)
At a few places I've worked, logging and util stuff had it's own core to prevent l1/l2 cache pollution (either using threads or shared memory just as long as you got it out of the hot path).