Boost logo

Boost :

From: Nicholas Neumann (nick2002_at_[hidden])
Date: 2021-03-03 20:00:22

I recently moved a project to boost.log from a homemade logger. I had
something like text_multifile_backend, so finding that as a drop-in
replacement was awesome.

Unfortunately, the performance when using text_multifile_backend on windows
is really bad, because the repeated file close operations (one per log
record) are unusually slow on windows. Repeatedly logging a string to the
same file via text_multifile_backend results in throughput of about 200 log
entries per second.

Just to quickly prove it is unique to windows, I made a simple program that
just opens, appends a single line, and then closes, an ofstream in a loop.
On a high-end windows machine with nvme ssd, 1000 iterations takes 2600ms.
On an older linux box with a sata ssd, the same takes 16ms.

What do others think about adding a note in the documentation about this
performance issue? It's bad enough that I think anyone on windows would
want to avoid the backend. It's not the backend's "fault" at all; I could
see some options for improving performance of the backend on windows, but
they definitely complicate the simplicity of the current approach.

(Side note - in googling the issue, other projects have been bitten -
notably mercurial on windows -

Boost list run by bdawes at, gregod at, cpdaniel at, john at