I appreciate your explanation. However, my concern is more about the overhead when calling MDC.getCopy() and not the extra overhead in MDC.put. Does that clarify my point?
At 04:42 PM 1/30/2004 -0500, [EMAIL PROTECTED] wrote:
None of the changes I have made should add any serious performance overhead.
Old behavior: MDC.put("name", "value"); (get is similar) - get thread local map - get value from tlm - if value is null - new Hashtable - put new hashtable in tlm - hashtable.put("name", "value");
New behavior: - get thread local map - get value from tlm - if value is null - getFactory (singleton) - factory.create (just calls new BasicMDCContainer which is just a subclass of hashtable) - put new container in tlm - container.put("name", "value");
(Logger is not affected)
No other code is run unless you use async appender, and that just calls clone on the container (delegates to the parent hashtable) by default.
I think maybe my explanation was unclear. This is a very low overhead change. Should I just send it for folks to look at?
If you feel that actual code will make the discussion easier, then please do.
-- Ceki G�lc�
For log4j documentation consider "The complete log4j manual"
ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
