rocketraman commented on issue #136:
URL: 
https://github.com/apache/logging-log4j-kotlin/issues/136#issuecomment-3339112015

   > Also, do your numbers take the caching done by `cachedLoggerOf()` into 
account?
   
   Yes they do.
   
   > Would inlining that function help?
   
   My benchmark shows it doesn't help, which makes sense because the "slow" 
call here is the Map cache lookup, not that top-level function call.
   
   ```
   LoggingBenchmark.companionObjectLookupInterfaceDirect        avgt   10  
13.769 ± 0.050  ns/op
   LoggingBenchmark.companionObjectLookupInterfaceFunctional    avgt   10  
13.847 ± 0.176  ns/op
   ```
   
   > they could simply use a FQN like
   > 
   > companion object {
   >     private val logger = org.apache.logging.log4j.kotlin.logger("name")
   > }
   
   Not really -- in addition to being ugly because of the FQN, this variant 
requires specifying the name as a parameter. People generally want to use the 
`T.logger()` receiver variant.
   
   > To me, convenience outweighs performance matters here.
   
   This is fair for many, if not most, use cases.
   
   How about this option: we move this property into an optional module 
`log4j-api-kotlin-autoprop`. People who want to use the property just have to 
add that module into their dependencies. Would that work for you?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to