[slf4j-dev] Release of SLF4J version 1.6.0-RC0
Robert Elliot
rob at lidalia.org.uk
Sun Apr 25 21:43:21 CEST 2010
On 25 Apr 2010, at 13:24, Joern Huxhorn wrote:
>
>>
>> I've just tidied it up using reflection to make it much easier to add the missing methods, though probably at a small performance cost.
>>
>
> It would perform better if you performed the method lookups in the c'tor, keeping references to the Method objects.
> I wouldn't use reflection here, though, just because every bit of performance is relevant in case of logging.
Just did some micro bench-marking, and was rather horrified - even with the method references cached in the constructor a call to is<Level>Enabled via reflection takes between 5 and 8 times longer than a direct call on the object in 64-bit Java 6 on a Mac, depending on how often the retrieved value is changed. So I'll revert that tidy-up - in general I prefer clean code to high performing code, but that's too high a price to pay. I thought reflection was meant to be pretty good now-a-days!
Shame, as it's much less verbose and much less repetitive, and consequently it would be much easier to add the missing methods. Almost makes me interested in a code generation step.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/slf4j-dev/attachments/20100425/ec53356a/attachment.html>
More information about the slf4j-dev
mailing list