swebb2066 commented on issue #347: URL: https://github.com/apache/logging-log4cxx/issues/347#issuecomment-2227157338
After #351, the benchmark comparing the current implementation (lock and copy appender pointers) versas no coping or lock on gcc 11 indicates a 30-40 ns overhead from the copy and no disernable lock contention: | Benchmark | Time | CPU | Time Old | Time New | CPU Old | CPU New | | --------- | ---------- | -------- | -------- | ------- | -------- | | Testing disabled logging request | +0.0000 | +0.0000 | 0 | 0 | 0 | 0 | | Testing disabled logging request/threads:6 | +0.0346 | +0.0346 | 0 | 0 | 1 | 1 | | Appending 5 char string using MessageBuffer, pattern: %m%n | -0.1557 | -0.1557 | 332 | 280 | 332 | 280 | | Appending 5 char string using MessageBuffer, pattern: %m%n/threads:6 | -0.0916 | -0.1142 | 397 | 361 | 2252 | 1995 | | Appending 49 char string using MessageBuffer, pattern: %m%n | -0.1265 | -0.1265 | 366 | 320 | 366 | 320 | | Appending 49 char string using MessageBuffer, pattern: %m%n/threads:6 | -0.0478 | -0.0749 | 442 | 421 | 2475 | 2290 | | Appending int value using MessageBuffer, pattern: %m%n | +0.0204 | +0.0204 | 500 | 510 | 500 | 510 | | Appending int value using MessageBuffer, pattern: %m%n/threads:6 | +0.0200 | -0.0074 | 442 | 451 | 2502 | 2484 | | Appending int+float using MessageBuffer, pattern: %m%n | +0.0091 | +0.0090 | 990 | 999 | 990 | 999 | | Appending int+float using MessageBuffer, pattern: %m%n/threads:6 | -0.0406 | -0.0499 | 549 | 527 | 3226 | 3065 | | Appending int value using MessageBuffer, pattern: [%d] %m%n | +0.0038 | +0.0038 | 546 | 548 | 546 | 548 | | Appending int value using MessageBuffer, pattern: [%d] [%c] [%p] %m%n | -0.0056 | -0.0055 | 605 | 602 | 605 | 602 | | Appending 49 char string using FMT, pattern: %m%n | -0.1537 | -0.1537 | 341 | 289 | 341 | 289 | | Appending 49 char string using FMT, pattern: %m%n/threads:6 | -0.0290 | -0.0623 | 445 | 432 | 2480 | 2326 | | Appending int value using FMT, pattern: %m%n | -0.1406 | -0.1406 | 369 | 317 | 369 | 317 | | Appending int value using FMT, pattern: %m%n/threads:6 | -0.0171 | -0.0526 | 445 | 437 | 2488 | 2357 | | Appending int+float using FMT, pattern: %m%n | -0.0714 | -0.0714 | 507 | 471 | 507 | 470 | | Appending int+float using FMT, pattern: %m%n/threads:6 | -0.0422 | -0.0589 | 485 | 465 | 2776 | 2612 | | Async, Sending int+float using MessageBuffer | +0.0188 | +0.0188 | 1204 | 1226 | 1204 | 1226 | | Async, Sending int+float using MessageBuffer/threads:6 | -0.1140 | -0.1127 | 557 | 494 | 3327 | 2952 | | Logging int+float using MessageBuffer, pattern: %d %m%n | +0.0148 | +0.0193 | 1137 | 1153 | 1132 | 1153 | | Logging int+float using MessageBuffer, pattern: %d %m%n/threads:6 | -0.0278 | -0.0226 | 1155 | 1123 | 5068 | 4954 | | OVERALL_GEOMEAN | -0.0448 | -0.0521 | 0 | 0 | 0 | 0 | -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
