You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Vlad Skarzhevskyy <sk...@gmail.com> on 2004/11/24 05:09:01 UTC
log4j LocationInfo performance.
Hello log4j developers.
I have spent some time measuring speed of class
org.apache.log4j.spi.LocationInfo.
The idea was that if I could use Java 1.4 Throwable.getStackTrace I
could get better performance when getting caller location information.
My findings could be found here:
http://jour.sourceforge.net/log4j_LocationInfo_performance.html
I found that in artificial tests I could get 4 times faster speed.
Unfortunately I did not get the same success in real application. But
this may be due to the test setup.
Please tell me what you think.
Definitely more performance tests should be done to prove that changes
to LocationInfo add performance befits.
Regards,
--
Vlad
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: log4j LocationInfo performance.
Posted by Vlad Skarzhevskyy <sk...@gmail.com>.
We have this discussion in our team every day.
Should product be oriented on "user" or "User".
So let the "user" run as it is is.
And let the "User" be able to increase the perfomance if he realy wants to. :)
As its stand now the perfomance benefit is arguable in my particular
case so we probably need to postpone this discussions till sombody
else will rise the issue.
While thinking I have other better idea for "The User"
Have you seen this: http://just4log.sourceforge.net/
The idea is to be able to use this project to inject location info
into byte code.
example in java code:
original:
log.debug("Stuff", moreStuff);
modified:
log.debugExt("my.class.myFunction(01):test.java", "Stuff", moreStuff);
This is just the idea :) but there should be a better way. Like to put
LocationInfo into stack and access this stack from the logger calss.
Don't know how to do this in java but in C it is posible. I will tak
to Lucas Bruand may be he has somebetter ideas.
On Wed, 24 Nov 2004 17:56:36 +0100, Ceki Gülcü <ce...@qos.ch> wrote:
> At 04:41 PM 11/24/2004, Vlad Skarzhevskyy wrote:
> >Ceki
> > I have not seen your new method in CVS. I was only reading at "whats
> >is planed" on the website.
>
> As your experience indicates, the "Plan? What Plan?" page was very much
> outdated.
>
> > Now I could not find this page again.
>
> The "Plan? What Plan?" page was removed because we did not really follow it.
>
> > It would be nice to have list of changes. Word or two and the way to
> >find this list online as well as planned featues.
>
> The HISTORY file is your best bet.
>
> >As to my tests.
> > I will test the reflection method. will keep you posted.
> >
> >Also I have another sugestion you have not answered!
> >getLocationInformation speed linearly depend on the stack size.
> >To it is faster to get new Throwable() as early as posible.
> >In my tests I got two times better perfomance for this.
>
> You have to weigh performance related considerations with ease of use.
> Having Mrs. Piggy specify whether she wants location info on a logger by
> logger basis sound like too much.
>
> >Also my question was why I don't see any speed improvments in my real
> >application?
> >May be there is somthing wrong with Throwable.getStackTrace() and threads.
> >Have you done any tests?
>
> It's hard to say.
>
>
>
> >--
> >Vlad
>
> --
> Ceki Gülcü
>
> The complete log4j manual: http://qos.ch/eclm
> Professional log4j support: http://qos.ch/log4jSupport
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>
>
--
Vlad
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: log4j LocationInfo performance.
Posted by Ceki Gülcü <ce...@qos.ch>.
At 04:41 PM 11/24/2004, Vlad Skarzhevskyy wrote:
>Ceki
> I have not seen your new method in CVS. I was only reading at "whats
>is planed" on the website.
As your experience indicates, the "Plan? What Plan?" page was very much
outdated.
> Now I could not find this page again.
The "Plan? What Plan?" page was removed because we did not really follow it.
> It would be nice to have list of changes. Word or two and the way to
>find this list online as well as planned featues.
The HISTORY file is your best bet.
>As to my tests.
> I will test the reflection method. will keep you posted.
>
>Also I have another sugestion you have not answered!
>getLocationInformation speed linearly depend on the stack size.
>To it is faster to get new Throwable() as early as posible.
>In my tests I got two times better perfomance for this.
You have to weigh performance related considerations with ease of use.
Having Mrs. Piggy specify whether she wants location info on a logger by
logger basis sound like too much.
>Also my question was why I don't see any speed improvments in my real
>application?
>May be there is somthing wrong with Throwable.getStackTrace() and threads.
>Have you done any tests?
It's hard to say.
>--
>Vlad
--
Ceki Gülcü
The complete log4j manual: http://qos.ch/eclm
Professional log4j support: http://qos.ch/log4jSupport
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: log4j LocationInfo performance.
Posted by Vlad Skarzhevskyy <sk...@gmail.com>.
Ceki
I have not seen your new method in CVS. I was only reading at "whats
is planed" on the website.
Now I could not find this page again.
It would be nice to have list of changes. Word or two and the way to
find this list online as well as planned featues.
As to my tests.
I will test the reflection method. will keep you posted.
Also I have another sugestion you have not answered!
getLocationInformation speed linearly depend on the stack size.
To it is faster to get new Throwable() as early as posible.
In my tests I got two times better perfomance for this.
Also my question was why I don't see any speed improvments in my real
application?
May be there is somthing wrong with Throwable.getStackTrace() and threads.
Have you done any tests?
Any Why don't you have perfomance results in distribution for 1.2.9
--
Vlad
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: log4j LocationInfo performance.
Posted by Ceki Gülcü <ce...@qos.ch>.
Hello Vlad,
Quoting [1],
This tests are done using log4j version 1.2.9, and java version: 1.4.2_05.
Have you looked at the latest code in the log4j CVS repository? See in
particular
the new org.apache.log4j.spi.location package [2]. We now use the same
technique
as your Java14LocationInfo with the same improvement results.
In your conclusion, you state:
"It would be nice to extend next version for log4j 1.3.0 with support
for java 1.4. Or allow to customize LocationInfo class."
But that is exactly what we have done! :-)
Your conclusions about the sluggishness of transporting LoggingEvent
objects over the wire is well taken. One way of achieving better
performance consists of having the LoggingEvent class take over its
own serialization. This leads to about 10 fold increase in
performance. However, this comes at the cost of losing serialization
time compatibility between previous versions of log4j and version 1.3.
I wonder how we can better coordinate our efforts to avoid duplicating our
mutual efforts.
By the way, you've made my day.
[1] http://jour.sourceforge.net/log4j_LocationInfo_performance.html
[2]
http://cvs.apache.org/viewcvs.cgi/logging-log4j/src/java/org/apache/log4j/spi/location/
or its tinyURL equivalent http://tinyurl.com/5gjdy
At 05:09 AM 11/24/2004, Vlad Skarzhevskyy wrote:
>Hello log4j developers.
>
> I have spent some time measuring speed of class
>org.apache.log4j.spi.LocationInfo.
[cut]
>--
>Vlad
--
Ceki Gülcü
The complete log4j manual: http://qos.ch/eclm
Professional log4j support: http://qos.ch/log4jSupport
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org