You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2021/12/27 05:18:49 UTC

[GitHub] [logging-log4cxx] swebb2066 opened a new pull request #88: Improve throughput when using disabled logging statements

swebb2066 opened a new pull request #88:
URL: https://github.com/apache/logging-log4cxx/pull/88


   Change the pointer to the Hierarchy from a std::weak_ptr to a raw pointer to avoid the lock(0 in Logger::isDisabled() functions.
   
   Also disconnects the Logger from the Hierarchy when the Hierarchy is destroyed.
   
   throughputtests output using these changes:
   `Benchmarking library only(no writing out):
   **************************************************************
   Benchmarking Single threaded: 1000000 messages
   **************************************************************
   Log4cxx NoFormat pattern: %m%n Elapsed: 2.557 secs 391,157/sec
   Log4cxx DateOnly pattern: [%d] %m%n Elapsed: 2.552 secs 391,836/sec
   Log4cxx DateClassLevel pattern: [%d] [%c] [%p] %m%n Elapsed: 2.572 secs 388,729/sec
   Log4cxx Logging with FMT Elapsed: 1.909 secs 523,721/sec
   Log4cxx Logging static string Elapsed: 2.062 secs 485,083/sec
   Log4cxx Logging static string with FMT Elapsed: 2.096 secs 476,990/sec
   Log4cxx Logging disabled debug Elapsed: 0.08675 secs 11,527,275/sec
   Log4cxx Logging disabled trace Elapsed: 0.08727 secs 11,459,057/sec
   Log4cxx Logging enabled debug Elapsed: 2.059 secs 485,615/sec
   Log4cxx Logging enabled trace Elapsed: 2.098 secs 476,611/sec
   **************************************************************
   Benchmarking multithreaded threaded: 1000000 messages/thread, 4 threads
   **************************************************************
   log4cxx: No appender could be found for logger (bench_logger).
   log4cxx: Please initialize the log4cxx system properly.
   Log4cxx Logging with FMT MT Elapsed: 3.734 secs 267,813/sec
   Log4cxx Logging with FMT MT Elapsed: 3.739 secs 267,426/sec
   Log4cxx Logging with FMT MT Elapsed: 3.759 secs 266,043/sec
   Log4cxx Logging with FMT MT Elapsed: 3.762 secs 265,849/sec
   **************************************************************
   Benchmarking multithreaded disabled: 1000000 messages/thread, 4 threads
   **************************************************************
   Log4cxx Logging disabled MT Elapsed: 0.2366 secs 4,227,422/sec
   Log4cxx Logging disabled MT Elapsed: 0.2459 secs 4,066,714/sec
   Log4cxx Logging disabled MT Elapsed: 0.2496 secs 4,006,421/sec
   Log4cxx Logging disabled MT Elapsed: 0.2552 secs 3,918,440/sec
   `
   
   throughputtests output prior to these changes:
   `Benchmarking library only(no writing out):
   **************************************************************
   Benchmarking Single threaded: 1000000 messages
   **************************************************************
   Log4cxx NoFormat pattern: %m%n Elapsed: 2.828 secs 353,625/sec
   Log4cxx DateOnly pattern: [%d] %m%n Elapsed: 2.767 secs 361,350/sec
   Log4cxx DateClassLevel pattern: [%d] [%c] [%p] %m%n Elapsed: 2.81 secs 355,882/sec
   Log4cxx Logging with FMT Elapsed: 2.088 secs 478,949/sec
   Log4cxx Logging static string Elapsed: 2.217 secs 451,045/sec
   Log4cxx Logging static string with FMT Elapsed: 2.302 secs 434,344/sec
   Log4cxx Logging disabled debug Elapsed: 0.1867 secs 5,357,277/sec
   Log4cxx Logging disabled trace Elapsed: 0.186 secs 5,375,506/sec
   Log4cxx Logging enabled debug Elapsed: 2.261 secs 442,245/sec
   Log4cxx Logging enabled trace Elapsed: 2.263 secs 441,886/sec
   **************************************************************
   Benchmarking multithreaded threaded: 1000000 messages/thread, 4 threads
   **************************************************************
   Log4cxx Logging with FMT MT Elapsed: 4.097 secs 244,063/sec
   Log4cxx Logging with FMT MT Elapsed: 4.105 secs 243,617/sec
   Log4cxx Logging with FMT MT Elapsed: 4.132 secs 242,014/sec
   Log4cxx Logging with FMT MT Elapsed: 4.132 secs 242,005/sec
   **************************************************************
   Benchmarking multithreaded disabled: 1000000 messages/thread, 4 threads
   **************************************************************
   Log4cxx Logging disabled MT Elapsed: 0.6538 secs 1,529,611/sec
   Log4cxx Logging disabled MT Elapsed: 0.6681 secs 1,496,778/sec
   Log4cxx Logging disabled MT Elapsed: 0.6699 secs 1,492,832/sec
   Log4cxx Logging disabled MT Elapsed: 0.6702 secs 1,492,142/sec
   `


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [logging-log4cxx] swebb2066 commented on pull request #88: Improve throughput when using disabled logging statements

Posted by GitBox <gi...@apache.org>.
swebb2066 commented on pull request #88:
URL: https://github.com/apache/logging-log4cxx/pull/88#issuecomment-1001372699


   Superceded by #90


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org