Re: LoggerStreams implementation

2004-10-17 Thread Christopher Smith
Curt Arnold wrote: No it is still helpful. I threw together the CVS stuff in a few hours to keep the conversation going and getting it to work and getting the API right were the priorities. Deriving log4cxx::basic_logstreambuf from std::basic_stringbuf was expedient to get things functional, b

Re: LoggerStreams implementation

2004-10-08 Thread Curt Arnold
I'm sorry, I appear to have wasted my time and yours. When you asked for construction metrics I had assumed you meant for your implementation. With your current scheme there would be no way to avoid the cost of instantiating std::basic_stringbuf, as it's not a templated parameter. No it is sti

Re: LoggerStreams implementation

2004-10-08 Thread Christopher Smith
Curt Arnold wrote: The benchmark, like all benchmarks, is synthetic. This one assumes that a log stream is allocated for each logging request which I would assume is very atypical. I'd expect that most of the cost is in the construction of std::basic_stringbuf, but would love to see a profile

Re: LoggerStreams implementation

2004-10-08 Thread Curt Arnold
On my home system (2.4GHz P4 running Gentoo & gcc-3.3) these are the numbers I got (this is the average time per iteration): CVS logstream Logging when disabled: 1600-1800ns Logging when enabled: 13000-15000ns My LoggingStream Logging when disabled: 40-50ns Logging when enabled: 15000-18000ns Th

Re: LoggerStreams implementation

2004-10-08 Thread Christopher Smith
Christopher Smith wrote: P.S.: I just noticed some performance optimizations to LocationInfo committed into CVS. I'll rerun and see if they have any impact on these results. Looks like it shaved off about 100ns per iteration across the board. --Chris

Re: LoggerStreams implementation

2004-10-08 Thread Christopher Smith
Christopher Smith wrote: Curt Arnold wrote: On Oct 7, 2004, at 2:51 PM, Christopher Smith wrote: 1) You pay the price of constructing std::basic_stream regardless of whether logging is turned on. Do you have any metrics on the cost of that? No, but I may have some in a week or so. I'll post them

Re: LoggerStreams implementation

2004-10-08 Thread Christopher Smith
Curt Arnold wrote: I mentioned this back in our earlier emails (http://nagoya.apache.org/eyebrowse/ReadMsg?listName=log4cxx- [EMAIL PROTECTED]&msgNo=272, see point 1), I was surprised when your submission didn't derive from basic_ostream. You were thinking inheritence and I was thinking deleg

Re: LoggerStreams implementation

2004-10-08 Thread Curt Arnold
On Oct 7, 2004, at 4:47 PM, Christopher Smith wrote: Curt Arnold wrote: On Oct 7, 2004, at 2:51 PM, Christopher Smith wrote: 1) You pay the price of constructing std::basic_stream regardless of whether logging is turned on. Do you have any metrics on the cost of that? No, but I may have some in a

Re: LoggerStreams implementation

2004-10-07 Thread Christopher Smith
Curt Arnold wrote: On Oct 7, 2004, at 2:51 PM, Christopher Smith wrote: 1) You pay the price of constructing std::basic_stream regardless of whether logging is turned on. Do you have any metrics on the cost of that? No, but I may have some in a week or so. I'll post them as soon as I do. I don't t

Re: LoggerStreams implementation

2004-10-07 Thread Curt Arnold
On Oct 7, 2004, at 2:51 PM, Christopher Smith wrote: Curt Arnold wrote: Some additional comments on the patch are available at the bug report, LOGCXX-18. The major difference is that this logstream is derived from std::basic_stream and can be passed to methods expecting that stream. The inser

Re: LoggerStreams implementation

2004-10-07 Thread Christopher Smith
Curt Arnold wrote: Some additional comments on the patch are available at the bug report, LOGCXX-18. The major difference is that this logstream is derived from std::basic_stream and can be passed to methods expecting that stream. The insertion operator will typically be short-circuited when

Re: LoggerStreams implementation

2004-10-07 Thread Curt Arnold
I've committed my stab at logging streams to the CVS. The stream based interface is defined in include/log4cxx/stream.h and there is a usage example in examples/stream.cpp. I've updated the Makefile.am's so the make based build will work (after an autogen), but I haven't updated the MSVC proj

Re: LoggerStreams implementation

2004-10-07 Thread Curt Arnold
Thanks for the submission. It wasn't quite what I had in mind. I'm trying to flesh my thoughts out right now (well after getting some sleep) and will reply tomorrow. On Oct 6, 2004, at 1:31 PM, Christopher Smith wrote: Curt Arnold wrote: Thanks, Please submit it as a bug request since that has

Re: LoggerStreams implementation

2004-10-06 Thread Christopher Smith
Curt Arnold wrote: Thanks, Please submit it as a bug request since that has a explicit statement that you are donating the code to ASF and I'll get it in shortly. Done. ID is LOGCXX-18. I fixed forcedLog before submitting it. --Chris

Re: LoggerStreams implementation

2004-10-06 Thread Curt Arnold
Thanks, Please submit it as a bug request since that has a explicit statement that you are donating the code to ASF and I'll get it in shortly.

Re: LoggerStreams implementation

2004-10-06 Thread Christopher Smith
Christopher Smith wrote: 7) The code is specifically designed so an optimizer can produce code that only checks logging levels once per log event. Ugh. I knew I'd make a mistake. ;-) This is not quite true. The current code actually requires 2 checks per log event. This is because on the implemen