On Mon, 2009-11-30 at 14:27 +0100, Oleg Kalnichevski wrote:
> On Sat, 2009-11-28 at 17:01 +0000, Tony Poppleton wrote:
> > Hi,
> >
> > I have run a JProfiler on my application that uses HttpClient to send
> > requests every 10 milliseconds. One interesting part of the results is
> > that the Log creation is actually consuming about 5% of the time, which
> > is significant considering I am trying to squeeze the most performance
> > out. For example:
> >
> > public class ClientParamsStack extends AbstractHttpParams {
> > private final Log log = LogFactory.getLog(getClass());
> >
> > I have always used static loggers myself, which avoid this problem, so I
> > did a tiny bit of research
> > (http://wiki.apache.org/jakarta-commons/Logging/StaticLog) and
> > apparently static isn't always the right choice.
> >
> >
> > Is there anything I can do to prevent the log creation from being a
> > slowdown, short of checking out the source tree and creating my own
> > custom patch?
> >
> > I haven't investigated fully yet, but ClientParamsStack class seems to
> > be the main culprit, so is there any way I can set it to use my own
> > custom implementation of this?
> >
>
> Tony,
>
> If log creation does indeed have such an adverse effect on performance,
> I would very much rather prefer to fix the problem in the library
> itself. If you are reasonably sure performance can be improved by
> eliminating certain log instances, please remove them and submit a patch
> for inclusion into the official code base.
>
> Cheers
>
> Oleg
>
Hhhm. I get good 5 to 7% performance improvement by eliminating Log
instances in ClientParamsStack and DefaultHttpRequestDirector classes. I
never imagined the performance penalty of the Log lookup operation was
so significant.
Tony,
Could you please open an issue in JIRA for this problem?
Oleg
>
> > Many thanks,
> > Tony
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]