4 ms·
That's kinda cool, I didn't know that was a thing but doesn't seem too difficult to achieve with a buffer. Problem though, most of the cpu time to log a messag
by aunty_helen 5y ago
That's kinda cool, I didn't know that was a thing but doesn't seem too difficult to achieve with a buffer.
Problem though, most of the cpu time to log a message is in preparing the log statement. Once you hand it off to a logging library you're off the critical path, probably on a background process and then off to the OS and sequential writes to disk (which is faaast).
There's also some benefit from having the other debug statements from previous correct runs to compare. If there's any state being set (you kinda deserve problems, but) it may help with debugging to have the previous messages.
And of course, the most difficult problems to solve are the ones that don't crash but run through feeling fine with values reversed / inverted / off by 1 etc.