Puppy
Puppy copied to clipboard
Logger performance due to open/seek/write/close system calls for each logged message
Running into a problem if there is a high rate of logging that the logger is unable to keep up and what is written on disk can lag behind several minutes. With all of the log messages being queued in memory.
Creating a test which logs via FileLogger(logFile,logFormat: logFormat, fileURL: fileURL, flushMode: .manual)
does not seem to help much on macOS: attaching using Instruments
and profiling using File Activity
.
For flushMode: .always
:
For flushMode: .manual
:
The only difference is sys_fstat64
duration; but how far behind the written log messages fall behind the current time does not seem to drastically change.
On Linux, sync() visible in a FlameGraph at least: