3 ms·
This expression is always evaluated, creating a new string object on the heap that has to be collected, whereas the format string one is only evaluated on deman
by konstruktor 12y ago
This expression is always evaluated, creating a new string object on the heap that has to be collected, whereas the format string one is only evaluated on demand (matching log level). That's why most logging frameworks go for the latter. I haven't seen benchmarks regarding the performance impact, though.