<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 25 Apr 2010, at 13:24, Joern Huxhorn wrote:</div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><font class="Apple-style-span" color="#000000"><br></font><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><br></div><div>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.</div><div><br></div></div></div></blockquote><div><br></div><div>It would perform better if you performed the method lookups in the c'tor, keeping references to the Method objects.</div><div>I wouldn't use reflection here, though, just because every bit of performance is relevant in case of logging.</div></div></div></blockquote></div><br><div>Just did some micro bench-marking, and was rather horrified - even with the method references cached in the constructor a call to is&lt;Level&gt;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. &nbsp;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. &nbsp;I thought reflection was meant to be pretty good now-a-days!</div><div><br></div><div>Shame, as it's much less verbose and much less repetitive, and consequently it would be much easier to add the missing methods. &nbsp;Almost makes me interested in a code generation step.</div></body></html>