Closed JakubValtar closed 5 years ago
Env_logger in fact uses meanwhile thread-local buffers, which might be the reason for the observed performance difference. I'll try some things out. Thanks for reporting!
Thanks! Definitely not high priority, format!
can be used as a workaround.
It seems that the performance is related to the number of values which are being printed out by write!
, including nested calls when your struct has struct fields which also need to be printed out.
Hi Jakub, I just published version 0.13.0 which fixes this issue!
Hi,
I noticed that formatting the message with
format!
before logging is much faster than letting the logger do it. I would expect the performance to be similar or the logger to be slightly faster. Is this an expected behavior?Here is a simple test program:
The length of the message does not matter that much, it's more about how many segments the
Display
implementation writes. Is there maybe some buffering problem?I can reproduce on Windows 10 with PowerShell and on Ubuntu Server.