swebb2066 opened a new pull request, #521: URL: https://github.com/apache/logging-log4cxx/pull/521
This PR scratches my itch of wondering how JSON generation performs compared to unstructured output. As the answer is "not great" I have made a couple of obvious improvements to JSONLayout. Here is the result (g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0): Comparing /tmp/old.json to /tmp/new.json | Benchmark | Time | CPU | Time Old | Time New | CPU Old | CPU New | | ---------- | ------ | ----- | ---------- | ---------- | --------- | --------- | | Logging int+float using MessageBuffer, pattern: %d %m%n | +0.0006 | +0.0005 | 1108 | 1108 | 1108 | 1108 | | Logging int+float using MessageBuffer, pattern: %d %m%n/threads:6 | +0.0286 | +0.0280 | 1056 | 1086 | 4898 | 5034 | | Logging int+float using MessageBuffer, JSON | -0.2252 | -0.2276 | 1933 | 1498 | 1933 | 1493 | | Logging int+float using MessageBuffer, JSON/threads:6 | -0.4687 | -0.2163 | 4553 | 2419 | 9561 | 7493 | | Sending int+float using MessageBuffer, JSON | -0.4840 | -0.4840 | 7362 | 3799 | 7361 | 3798 | | Sending int+float using MessageBuffer, JSON/threads:6 | -0.3718 | -0.3210 | 20538 | 12902 | 28243 | 19178 | -- 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-unsubscr...@logging.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org