<div dir="ltr">The 10% logging was debug logging, perhaps that was exacerbated during profiling, but i&#39;d expect it to be exacerbated uniformly-sh.<div><br></div><div style>The JSword logger doesn&#39;t define a isDebugEnabled as far as I can see. Also, showLocation is true by default, so lots of work happens every time. The logger implementation seems to rely on the underlying functionality as to whether it is logged out to a screen/stream/file/etc. but by then all the work has been done.</div>
<div style><br></div><div style>Due to the missing isDebugEnable type functions, JSword methods across the board presumably do quite a lot of concatenation before even calling the logger, i.e. passing a concatenation of parameters. (not sure whether the profiler would wrap that into the log call, or the caller method, probably the caller)</div>
<div><br></div><div style>Unfortunately, the third party is not in charge of showLocation. And can&#39;t change it as the moment except on a per logger basis. Perhaps it was the particular operation. It&#39;s partly because of String concatenations.</div>
<div style><br></div><div style>Cheers</div><div style>Chris</div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 5 February 2013 23:04, DM Smith <span dir="ltr">&lt;<a href="mailto:dmsmith@crosswire.org" target="_blank">dmsmith@crosswire.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On Feb 5, 2013, at 3:37 PM, Chris Burrell &lt;<a href="mailto:chris@burrell.me.uk">chris@burrell.me.uk</a>&gt; wrote:<br>
<br>
&gt; Hi<br>
&gt;<br>
&gt; I was doing a bit of performance tuning for STEP earlier, to see how I could speed up some of the searches. I found that possibly up to 10% of the time could be spent logging.<br>
<br>
</div>Seem strange that 10 percent of the time is managing errors. (You need to look into configuring the logger to only log errors, if you aren&#39;t already). Then the calls to logger are lightweight. Pretty much a no-op.<br>

<br>
There&#39;s a bug in changing the LogLevel and in specifying the logger config. But I don&#39;t remember.<br>
<div class="im"><br>
&gt;<br>
&gt; I&#39;m guessing that&#39;s because of the bit that tries to throw an Exception to capture the stack trace.<br>
<br>
</div>We want that when we are handling errors. Maybe we don&#39;t want to do it for all levels of logging. I.e. configure it.<br>
<br>
See the &quot;showLocation&quot; part of the getLogger() call.<br>
<div class="im"><br>
&gt;<br>
&gt; Is there any reason why we&#39;re not using the java loggers directly?<br>
<br>
</div>We are using the java loggers. We don&#39;t use it directly since we were using a different logger before the java loggers.<br>
<div class="im"><br>
&gt; Or why we&#39;re not using log4j (i see there&#39;s a not about keeping it small)<br>
<br>
</div>That&#39;s what we were using.<br>
<br>
The philosophy of JSword architecture is to:<br>
define an abstract interface<br>
create a basic implementation of the abstraction<br>
use a plugin to define which implementation is being used. (Not used wrt logging)<br>
<br>
By hiding behind the concrete abstraction, we were able to swap out implementations.<br>
<br>
Hope this helps,<br>
        DM<br>
<br>
<br>
</blockquote></div><br></div>