https://issues.apache.org/bugzilla/show_bug.cgi?id=45721





--- Comment #14 from Ceki Gulcu <[EMAIL PROTECTED]>  2008-09-05 08:55:42 PST ---

James Strachan has kindly contributed his patch to the logback project as well.
See http://jira.qos.ch/browse/LBGENERAL-23

After spending several days working on this problem, I discovered that a one
line change makes a big impact on performance.

Replacing

  URL resource = type.getClassLoader().getResource(  \
                  type.getName().replace('.', '/') + ".class");
with

  URL resource = type.getProtectionDomain().getCodeSource().getLocation();

My tests show 12 fold improvement in performance. The time it takes to handle a
stack trace goes down from 5 milliseconds to 400 microseconds. The same code
without James' patch, that is without package version extraction, takes 100
microseconds. 

HTH,


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to