[Issue 18388] std.experimental.logger slow performance

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 6 20:14:05 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18388

--- Comment #7 from Robert Schadek <rburners at gmail.com> ---
I didn't say anything about api calls. That is not the problem.
The problem with the benchmark is that the threads share memory. That means
each write will, given you tested on a multicore cpu, invalidates some of the
CPUs caches. That means the program has to go to RAM, and that is slow, really
slow.
I bet you a drink at next years DConf, that if you check perf you will find
that the CPU is waiting for data from RAM most of the execution time.

You need to flush after each log call. If there is a log buffer and the program
crashes, you might not see the log line that indicates the problem.

--


More information about the Digitalmars-d-bugs mailing list