Benchmarks and String Creation
- Dominant language
- Java
- Stars
- 1.5k
- Forks
- 133
- Avg merge
- 6m
- Merged PRs (30d)
- 7
Description
Doesn't this style of logging api incur the cost of string creation, even when the logger is off ?
I haven't looked at the byte code, but I'm wondering what exactly is ment by 'essentially free'.
I remember reading in the initial log4j that the whole reason for the usage of the imperative paradigms if, i.e.;
if (log.isDebugEnabled()) {
log.debug("foo");
}
Was to avoid the cost of the creation of the string "foo". The impartive if statement would create branching bytecode, with GOTO statements. IIt would seem to me that this functional stream log API style would result in a lot of extra string creation and garbage collection. Has anyone benchmarked it ? Where are the benchmarks ?
Contributor guide
Assessment
This issue has not been assessed yet.