Hi everybody, I have a small question about perfor...
# kotlin-logging
v
Hi everybody, I have a small question about performance of
<http://logger.info|logger.info>("blah $foo $bar")
vs
<http://logger.info|logger.info> { "blah $foo $bar" }
. I suppose: 1. in the first case the string template is always constructed 2. in the second one only when the log level is set to make it visible. But there is extra lambda, etc. Is it something I should worry about under a rather intensive load (backend) or it’s not worth optimizing?
o
I don't know if you should be worried or not, it's really depends on your usage. From my experience there wasn't an issue with the lambda. Anyway, we have an open issue to come up with a solution: https://github.com/MicroUtils/kotlin-logging/issues/34
👍 2