This content has been marked as final.
Show 6 replies
-
1. Re: Performance problem in VFS
dmlloyd Jun 14, 2007 11:39 PM (in response to dmlloyd)Worth mentioning that of the 3,138,677 times that org.jboss.logging.Logger.getLogger() has been called, 3,133,812 came from org.jboss.virtual.plugins.context.AbstractVirtualFileHandler..
-
2. Re: Performance problem in VFS
alesj Jun 15, 2007 3:31 AM (in response to dmlloyd)"david.lloyd@jboss.com" wrote:
The loggers should be made static. If this kind of per-class logger behavior is desired, how about using an abstract getLogger() method which initialized a protected log field on the base class.
What about if you changed this temp and try to run it again?
I can prepare a patch for you to try, just let me know. -
3. Re: Performance problem in VFS
dmlloyd Jun 15, 2007 9:45 AM (in response to dmlloyd)"alesj" wrote:
What about if you changed this temp and try to run it again?
I just replaced the logger with a simple static one and so far, the results are dramatically better. Don't have numbers yet though.
How important is it to have the logger name set to the concrete class for these classes? If it's very important, I can put in an abstract method to grab a static logger from the concrete class. Or you can. :-) -
4. Re: Performance problem in VFS
dmlloyd Jun 15, 2007 10:09 AM (in response to dmlloyd)Looks like the logger creation, which was high up on the hot spots list, is now completely gone from that list. I'd call it a win.
-
5. Re: Performance problem in VFS
starksm64 Jun 15, 2007 12:42 PM (in response to dmlloyd)Just make it static. If subclasses need a different logger name they can add their own static instance as well.
-
6. Re: Performance problem in VFS
dmlloyd Jun 15, 2007 1:00 PM (in response to dmlloyd)I don't have commit access. But someone who does can merge this patch:
Index: src/main/java/org/jboss/virtual/plugins/context/AbstractVirtualFileHandler.java =================================================================== --- src/main/java/org/jboss/virtual/plugins/context/AbstractVirtualFileHandler.java +++ src/main/java/org/jboss/virtual/plugins/context/AbstractVirtualFileHandler.java @@ -53,7 +53,7 @@ public abstract class AbstractVirtualFileHandler implements VirtualFileHandler { /** The log */ - protected Logger log = Logger.getLogger(getClass()); + protected static final Logger log = Logger.getLogger(AbstractVirtualFileHandler.class); /** serialVersionUID */ private static final long serialVersionUID = 1L; /** The class serial fields */ @@ -397,7 +397,5 @@ this.context = factory.getVFS(rootURI); this.references = new AtomicInteger(0); this.vfsUrl = (URL)fields.get("vfsUrl", null); - // Restore the log - log = Logger.getLogger(getClass()); } }