{"id":16284979,"url":"https://github.com/goodforgod/java-logger-benchmark","last_synced_at":"2025-03-20T02:31:21.586Z","repository":{"id":85770646,"uuid":"462150242","full_name":"GoodforGod/java-logger-benchmark","owner":"GoodforGod","description":"🧪 Different Java Loggers Benchmarks.","archived":false,"fork":false,"pushed_at":"2023-10-19T05:35:16.000Z","size":119,"stargazers_count":16,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-17T13:54:34.145Z","etag":null,"topics":["benchmark","java","log4j","logback","logging","slf4j","system-logger"],"latest_commit_sha":null,"homepage":"http://goodforgod.dev/java-logger-benchmark/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GoodforGod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-02-22T05:21:12.000Z","updated_at":"2023-10-19T05:19:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"76ebefd4-f9d5-4cbf-836f-1d62594a5e7b","html_url":"https://github.com/GoodforGod/java-logger-benchmark","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":"GoodforGod/java-jmh-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodforGod%2Fjava-logger-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodforGod%2Fjava-logger-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodforGod%2Fjava-logger-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodforGod%2Fjava-logger-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoodforGod","download_url":"https://codeload.github.com/GoodforGod/java-logger-benchmark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244538589,"owners_count":20468745,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","java","log4j","logback","logging","slf4j","system-logger"],"created_at":"2024-10-10T19:21:47.783Z","updated_at":"2025-03-20T02:31:21.045Z","avatar_url":"https://github.com/GoodforGod.png","language":"Java","readme":"# Java Logger Benchmark\n\n[![GitHub Action](https://github.com/goodforgod/java-logger-benchmark/workflows/Java%20CI/badge.svg)](https://github.com/GoodforGod/java-logger-benchmark/actions?query=workflow%3A%22Java+CI%22)\n\nJMH Benchmark for different **synchronous** Java Logger implementations.\n\nIdea of this benchmark is to put all loggers in the same conditions and measure how they all handle the most common scenarios. \nCompare their implementation in such scenarios, some loggers have more flexible configurations, different APIs, some have more features, different implementations.\n\nAt the end it's your choice, do you want flexibility some loggers provide and what are trade-offs of each implementation.\n\n## Loggers\n\nBenchmark features these loggers:\n- [io.goodforgod:slf4j-simple-logger:0.13.0](https://github.com/GoodforGod/slf4j-simple-logger)\n- [org.slf4j:slf4j-simple:1.7.36](https://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html)\n- [ch.qos.logback:logback-classic:1.2.11](https://logback.qos.ch/)\n- [org.apache.logging.log4j:log4j-core:2.17.2](https://logging.apache.org/log4j/2.x/index.html)\n- [System.Logger](https://docs.oracle.com/javase/9/docs/api/java/lang/System.Logger.html) (Java 17)\n\n## Benchmark\n\nBenchmark consists of different common logging scenarios developers typically use in their applications, by the name of the test you can understand what this situation try to emulate, here is full list of tests:\n- messageAndStacktrace         \n- messageWithoutArguments       \n- messageOneArgumentInTheEnd    \n- messageOneArgumentInTheMiddle  \n- messageOneArgumentInTheStart   \n- messageTwoArgumentInTheEnd    \n- messageTwoArgumentInTheMiddle \n- messageTwoArgumentInTheStart \n- messageThreeArgumentInTheEnd\n- messageThreeArgumentInTheMiddle\n- messageThreeArgumentInTheStart\n\nHere are corresponding examples of resulted log messages (excluding *messageAndStacktrace* due to big stacktrace):\n```text\n2022-03-22T15:33:48.723 [INFO] io.goodforgod.benchmark.LoggerBenchmark - Message is printed for this logger without arguments\n2022-03-22T15:33:48.723 [INFO] io.goodforgod.benchmark.LoggerBenchmark - Message is printed for this logger and with the argument: FirstArgument\n2022-03-22T15:33:48.723 [INFO] io.goodforgod.benchmark.LoggerBenchmark - Message is printed for FirstArgument argument for this logger\n2022-03-22T15:33:48.723 [INFO] io.goodforgod.benchmark.LoggerBenchmark - FirstArgument argument and message is printed for this logger\n2022-03-22T15:33:48.723 [INFO] io.goodforgod.benchmark.LoggerBenchmark - Message is printed for this logger and with arguments FirstArgument and SecondArgument\n2022-03-22T15:33:48.723 [INFO] io.goodforgod.benchmark.LoggerBenchmark - Message is printed for FirstArgument and SecondArgument argument for this logger\n2022-03-22T15:33:48.723 [INFO] io.goodforgod.benchmark.LoggerBenchmark - FirstArgument and SecondArgument arguments and message is printed for this logger\n2022-03-22T15:33:48.723 [INFO] io.goodforgod.benchmark.LoggerBenchmark - Message is printed for this logger and with arguments FirstArgument and SecondArgument and ThirdArgument\n2022-03-22T15:33:48.723 [INFO] io.goodforgod.benchmark.LoggerBenchmark - Message is printed for FirstArgument and SecondArgument and ThirdArgument argument for this logger\n2022-03-22T15:33:48.723 [INFO] io.goodforgod.benchmark.LoggerBenchmark - FirstArgument and SecondArgument and ThirdArgument argument and message is printed for this logger\n```\n\nIf you want to look at benchmark details, you can [check it here](https://github.com/GoodforGod/java-logger-benchmark/tree/master/benchmark/src/main/java/io/goodforgod/benchmark).\n\n### Layout\n\nAll loggers participants are configured to the same layout, so the all participants will be in equal conditions.\n\nPseudo layout for all loggers:\n\n`{date} [{level}] {logger} - {message}{separator}{throwable with stacktrace}`\n\nDescription of layout:\n- date - uses formatter `yyyy-MM-dd'T'HH:mm:ss.SSS`\n- level - logging level\n- logger - logger full class name\n- message - logging message\n- separator - new line to separate logging messages\n- stacktrace - exception stacktrace\n\n### Configuration\n\nAll loggers use synchronous output, **without any async appending mechanism**.\n\nAll loggers are configured to output to *STDERR*.\n\nBenchmark emulates real world usage of loggers, same way logger will be used in real running application.\nTo achieve this, benchmark uses real IO output for loggers, but to mitigate IO of the specific machine and console output,\nall loggers output is redirected to /dev/null.\nThis is done to benchmark how loggers are working in real environment including IO interactions and avoid benchmarking how machine prints data to STDOUT where benchmark is running at.\n\nLoggers have different implementations and such huge performance gaps (as seen by results) occur mostly due to some loggers accessing IO more frequently than others.\nSo measuring IO interactions is indented and critical to receive real world insights.\n\n## Setups\n\nJMH precaution:\n```text\nREMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on\nwhy the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial\nexperiments, perform baseline and negative tests that provide experimental control, make sure\nthe benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts.\nDo not assume the numbers tell you what you want them to tell.\n```\n\n### Setup 1\n\nThis benchmark results are based on run inside **GitHub CI** and **have forwarded stderr to /dev/null**.\n\nBenchmark setup configuration:\n- OS: Ubuntu ([Github CI](https://github.com/GoodforGod/java-logger-benchmark/actions))\n- Processor: Unknown\n- Java: JDK 17.0.2, OpenJDK 64-Bit Server VM, 17.0.2+8-LTS\n- [Execution](https://github.com/GoodforGod/java-logger-benchmark/blob/master/.github/workflows/gradle.yml#L37-L50): *java -jar benchmark-name.jar 2\u003e/dev/null*\n\n#### Raw Results\n\n| Benchmark | Warmup | Runs | Units | [goodforgod-simple](https://github.com/GoodforGod/slf4j-simple-logger) | [logback](https://logback.qos.ch/) | [log4j](https://logging.apache.org/log4j/2.x/index.html) | [slf4j-simple](https://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html) | [java-system](https://docs.oracle.com/javase/9/docs/api/java/lang/System.Logger.html) |\n|---|---|---|---|---|---|---|---|---|\n| messageAndStacktrace            | 2 | 6 | ops/s | 118216±813 | 115822±428 | 104783±501 | 13338±223 | 40445±203 |\n| messageWithoutArguments         | 2 | 6 | ops/s | 499217±1199 | 473321±5493 | 417106±6782 | 175836±1835 | 43540±467 |\n| messageOneArgumentInTheEnd      | 2 | 6 | ops/s | 458897±4559 | 443582±2258 | 400907±5836 | 169457±3192 | 40692±811 |\n| messageOneArgumentInTheMiddle   | 2 | 6 | ops/s | 473144±13985 | 451131±15834 | 422485±5795 | 173946±1803 | 40464±552 |\n| messageOneArgumentInTheStart    | 2 | 6 | ops/s | 460671±4028 | 432312±2706 | 406973±6916 | 173542±2095 | 41138±587 |\n| messageTwoArgumentInTheEnd      | 2 | 6 | ops/s | 452458±6389 | 444213±3966 | 397294±7014 | 164550±3379 | 40661±531 |\n| messageTwoArgumentInTheMiddle   | 2 | 6 | ops/s | 432949±5454 | 442847±5500 | 390417±3958 | 168683±1862 | 41380±403 |\n| messageTwoArgumentInTheStart    | 2 | 6 | ops/s | 448363±4246 | 440998±4881 | 392745±10002 | 167334±2699 | 39528±231 |\n| messageThreeArgumentInTheEnd    | 2 | 6 | ops/s | 423541±3972 | 426526±5837 | 396242±8698 | 169260±1842 | 40128±464 |\n| messageThreeArgumentInTheMiddle | 2 | 6 | ops/s | 430087±2801 | 409115±3378 | 392355±5064 | 167569±9936 | 40184±244 |\n| messageThreeArgumentInTheStart  | 2 | 6 | ops/s | 425695±2946 | 422243±7029 | 373625±6822 | 168490±848 | 39986±586 |\n\nYou can validate [results yourself](https://github.com/GoodforGod/java-logger-benchmark/actions/runs/2004818675).\n\n#### Processed Results\n\nIf we take [goodforgod-simple-logger](https://github.com/GoodforGod/slf4j-simple-logger) as baseline and compute other loggers performance based on numbers above:\n\n| Benchmark                       | [goodforgod-simple](https://github.com/GoodforGod/slf4j-simple-logger) | [logback](https://logback.qos.ch/) | [log4j](https://logging.apache.org/log4j/2.x/index.html) | [slf4j-simple](https://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html) | [java-system](https://docs.oracle.com/javase/9/docs/api/java/lang/System.Logger.html) |\n| ------------------------------- | ----------------- | ------- | ----- | ------------ | ----------- |\n| messageAndStacktrace            | 100               | 98.0    | 88.6  | 11.3         | 34.2        |\n| messageWithoutArguments         | 100               | 94.8    | 83.6  | 35.2         | 8.7         |\n| messageOneArgumentInTheEnd      | 100               | 96.7    | 87.4  | 36.9         | 8.9         |\n| messageOneArgumentInTheMiddle   | 100               | 95.3    | 89.3  | 36.8         | 8.6         |\n| messageOneArgumentInTheStart    | 100               | 93.8    | 88.3  | 37.7         | 8.9         |\n| messageTwoArgumentInTheEnd      | 100               | 98.2    | 87.8  | 36.4         | 9.0         |\n| messageTwoArgumentInTheMiddle   | 100               | 102.3   | 90.2  | 39.0         | 9.6         |\n| messageTwoArgumentInTheStart    | 100               | 98.4    | 87.6  | 37.3         | 8.8         |\n| messageThreeArgumentInTheEnd    | 100               | 100.7   | 93.6  | 40.0         | 9.5         |\n| messageThreeArgumentInTheMiddle | 100               | 95.1    | 91.2  | 39.0         | 9.3         |\n| messageThreeArgumentInTheStart  | 100               | 99.2    | 87.8  | 39.6         | 9.4         |\n\n\nIf we shrink results even more and compute average for all messages with arguments as single result then:\n\n| Benchmark              | [goodforgod-simple](https://github.com/GoodforGod/slf4j-simple-logger) | [logback](https://logback.qos.ch/) | [log4j](https://logging.apache.org/log4j/2.x/index.html) | [slf4j-simple](https://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html) | [java-system](https://docs.oracle.com/javase/9/docs/api/java/lang/System.Logger.html) |\n| ---------------------- | ----------------- | ------- | ----- | ------------ | ----------- |\n| message and stacktrace | 100               | 98.0    | 88.6  | 11.3         | 34.2        |\n| message with arguments | 100               | 97.5    | 88.7  | 37.8         | 9.1         |\n\n![Setup 1](docs/setup-1.png)\n\n### Setup 2\n\nThis benchmark **have forwarded stderr to NUL** *(/dev/null analog in windows)*\n\nBenchmark setup configuration:\n- OS: Windows 10\n- Processor: AMD Ryzen 2600X\n- Java: OpenJDK 64-Bit Server VM (build 17+35-2724, mixed mode, sharing)\n- Execution: *java -jar benchmark-name.jar 2\u003eNUL*\n\n#### Raw Results\n\n| Benchmark | Warmup | Runs | Units | [goodforgod-simple](https://github.com/GoodforGod/slf4j-simple-logger) | [logback](https://logback.qos.ch/) | [log4j](https://logging.apache.org/log4j/2.x/index.html) | [slf4j-simple](https://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html) | [java-system](https://docs.oracle.com/javase/9/docs/api/java/lang/System.Logger.html) |\n|---|---|---|---|---|---|---|---|---|\n| messageAndStacktrace            | 2 | 6 | ops/s | 58718±669 | 54617±240 | 43765±605 | 2684±142 | 22721±262 |\n| messageWithoutArguments         | 2 | 6 | ops/s | 120257±34208 | 101818±5985 | 89485±12457 | 32231±4528 | 31956±747 |\n| messageOneArgumentInTheEnd      | 2 | 6 | ops/s | 116935±32015 | 93380±13191 | 87549±1835 | 43576±4416 | 29963±355 |\n| messageOneArgumentInTheMiddle   | 2 | 6 | ops/s | 137995±36420 | 82164±3273 | 90059±17408 | 40252±9626 | 30299±167 |\n| messageOneArgumentInTheStart    | 2 | 6 | ops/s | 100351±19414 | 88131±5613 | 92676±18736 | 41611±9423 | 30424±353 |\n| messageTwoArgumentInTheEnd      | 2 | 6 | ops/s | 95318±4567 | 85102±3035 | 87795±7094 | 44082±4324| 29248±548 |\n| messageTwoArgumentInTheMiddle   | 2 | 6 | ops/s | 101764±13604 | 86166±987 | 96163±28330 | 41920±7623 | 30086±642 |\n| messageTwoArgumentInTheStart    | 2 | 6 | ops/s | 97099±14191 | 91736±10191 | 85855±4260 | 48236±8364 | 29137±518 |\n| messageThreeArgumentInTheEnd    | 2 | 6 | ops/s | 99141±11514 | 91344±8744 | 89784±14493 | 46913±3136 | 29543±371 |\n| messageThreeArgumentInTheMiddle | 2 | 6 | ops/s | 96524±10997 | 90234±1231 | 89083±11264 | 38981±3724 | 30155±409 |\n| messageThreeArgumentInTheStart  | 2 | 6 | ops/s | 125277±10888 | 83704±1428 | 86095±2454 | 40526±13953 | 29521±311 |\n\n#### Processed Results\n\nIf we take [goodforgod-simple-logger](https://github.com/GoodforGod/slf4j-simple-logger) as baseline and compute other loggers performance based on numbers above:\n\n| Benchmark                       | [goodforgod-simple](https://github.com/GoodforGod/slf4j-simple-logger) | [logback](https://logback.qos.ch/) | [log4j](https://logging.apache.org/log4j/2.x/index.html) | [slf4j-simple](https://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html) | [java-system](https://docs.oracle.com/javase/9/docs/api/java/lang/System.Logger.html) |\n| ------------------------------- | ----------------- | ------- | ----- | ------------ | ----------- |\n| messageAndStacktrace            | 100               | 93.0    | 74.5  | 4.6          | 38.7        |\n| messageWithoutArguments         | 100               | 84.7    | 74.4  | 26.8         | 26.6        |\n| messageOneArgumentInTheEnd      | 100               | 79.9    | 74.9  | 37.3         | 25.6        |\n| messageOneArgumentInTheMiddle   | 100               | 59.5    | 65.3  | 29.2         | 22.0        |\n| messageOneArgumentInTheStart    | 100               | 87.8    | 92.4  | 41.5         | 30.3        |\n| messageTwoArgumentInTheEnd      | 100               | 89.3    | 92.1  | 46.2         | 30.7        |\n| messageTwoArgumentInTheMiddle   | 100               | 84.7    | 94.5  | 41.2         | 29.6        |\n| messageTwoArgumentInTheStart    | 100               | 94.5    | 88.4  | 49.7         | 30.0        |\n| messageThreeArgumentInTheEnd    | 100               | 92.1    | 90.6  | 47.3         | 29.8        |\n| messageThreeArgumentInTheMiddle | 100               | 93.5    | 92.3  | 40.4         | 31.2        |\n| messageThreeArgumentInTheStart  | 100               | 66.8    | 68.7  | 32.3         | 23.6        |\n\n\nIf we shrink results even more and compute average for all messages with arguments as single result then:\n\n| Benchmark              | [goodforgod-simple](https://github.com/GoodforGod/slf4j-simple-logger) | [logback](https://logback.qos.ch/) | [log4j](https://logging.apache.org/log4j/2.x/index.html) | [slf4j-simple](https://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html) | [java-system](https://docs.oracle.com/javase/9/docs/api/java/lang/System.Logger.html) |\n| ---------------------- | ----------------- | ------- | ----- | ------------ | ----------- |\n| message and stacktrace | 100               | 93.0    | 74.5  | 4.6          | 38.7        |\n| message with arguments | 100               | 83.3    | 83.3  | 39.2         | 27.9        |\n\n![Setup 2](docs/setup-2.png)\n\n### Setup 3\n\nThis benchmark **have forwarded stderr to NUL** *(/dev/null analog in windows)*\n\nBenchmark setup configuration:\n- OS: Windows 10\n- Processor: Intel i5-6200U\n- Java: OpenJDK 64-Bit Server VM (build 17.0.1+12-39, mixed mode, sharing)\n- Execution: *java -jar benchmark-name.jar 2\u003eNUL*\n\n#### Raw Results\n\n| Benchmark | Warmup | Runs | Units | [goodforgod-simple](https://github.com/GoodforGod/slf4j-simple-logger) | [logback](https://logback.qos.ch/) | [log4j](https://logging.apache.org/log4j/2.x/index.html) | [slf4j-simple](https://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html) | [java-system](https://docs.oracle.com/javase/9/docs/api/java/lang/System.Logger.html) |\n|---|---|---|---|---|---|---|---|---|\n| messageAndStacktrace            | 2 | 6 | ops/s | 44741±1227 | 30574±551 | 28409±718 | 2074±166 | 15384±161 |\n| messageWithoutArguments         | 2 | 6 | ops/s | 77648±2357 | 72632±2107 | 70858±4008 | 33142±4502 | 20126±5878 |\n| messageOneArgumentInTheEnd      | 2 | 6 | ops/s | 75533±4976 | 70459±1576 | 67934±3651 | 32307±12165 | 20420±693 |\n| messageOneArgumentInTheMiddle   | 2 | 6 | ops/s | 75453±8568 | 71517±3054 | 65894±6387 | 31073±6345 | 20141±585 |\n| messageOneArgumentInTheStart    | 2 | 6 | ops/s | 73486±15079 | 66942±2062 | 66961±1409 | 31229±7186 | 20163±276 |\n| messageTwoArgumentInTheEnd      | 2 | 6 | ops/s | 75008±1818 | 66768±4096 | 65697±1048 | 32632±448 | 20421±265 |\n| messageTwoArgumentInTheMiddle   | 2 | 6 | ops/s | 75396±1473 | 69392±7265 | 68996±4110 | 30265±3249 | 20178±344 |\n| messageTwoArgumentInTheStart    | 2 | 6 | ops/s | 75785±2851 | 68737±4562 | 67683±1720 | 34428±996 | 20206±239 |\n| messageThreeArgumentInTheEnd    | 2 | 6 | ops/s | 75579±4230 | 66103±2858 | 66542±2149 | 30621±5432 | 20232±371 |\n| messageThreeArgumentInTheMiddle | 2 | 6 | ops/s | 74463±1725 | 69847±1797 | 66406±1474 | 30986±4792 | 20311±333 |\n| messageThreeArgumentInTheStart  | 2 | 6 | ops/s | 75444±1727 | 68149±3567 | 66786±1621 | 30203±4660 | 20280±315 |\n\n#### Processed Results\n\nIf we take [goodforgod-simple-logger](https://github.com/GoodforGod/slf4j-simple-logger) as baseline and compute other loggers performance based on numbers above:\n\n| Benchmark                       | [goodforgod-simple](https://github.com/GoodforGod/slf4j-simple-logger) | [logback](https://logback.qos.ch/) | [log4j](https://logging.apache.org/log4j/2.x/index.html) | [slf4j-simple](https://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html) | [java-system](https://docs.oracle.com/javase/9/docs/api/java/lang/System.Logger.html) |\n| ------------------------------- | ----------------- | ------- | ----- | ------------ | ----------- |\n| messageAndStacktrace            | 100               | 68.3    | 63.5  | 4.6          | 34.4        |\n| messageWithoutArguments         | 100               | 93.5    | 91.3  | 42.7         | 25.9        |\n| messageOneArgumentInTheEnd      | 100               | 93.3    | 89.9  | 42.8         | 27.0        |\n| messageOneArgumentInTheMiddle   | 100               | 94.8    | 87.3  | 41.2         | 26.7        |\n| messageOneArgumentInTheStart    | 100               | 91.1    | 91.1  | 42.5         | 27.4        |\n| messageTwoArgumentInTheEnd      | 100               | 89.0    | 87.6  | 43.5         | 27.2        |\n| messageTwoArgumentInTheMiddle   | 100               | 92.0    | 91.5  | 40.1         | 26.8        |\n| messageTwoArgumentInTheStart    | 100               | 90.7    | 89.3  | 45.4         | 26.7        |\n| messageThreeArgumentInTheEnd    | 100               | 87.5    | 88.0  | 40.5         | 26.8        |\n| messageThreeArgumentInTheMiddle | 100               | 93.8    | 89.2  | 41.6         | 27.3        |\n| messageThreeArgumentInTheStart  | 100               | 90.3    | 88.5  | 40.0         | 26.9        |\n\n\nIf we shrink results even more and compute average for all messages with arguments as single result then:\n\n| Benchmark              | [goodforgod-simple](https://github.com/GoodforGod/slf4j-simple-logger) | [logback](https://logback.qos.ch/) | [log4j](https://logging.apache.org/log4j/2.x/index.html) | [slf4j-simple](https://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html) | [java-system](https://docs.oracle.com/javase/9/docs/api/java/lang/System.Logger.html) |\n| ---------------------- | ----------------- | ------- | ----- | ------------ | ----------- |\n| message and stacktrace | 100               | 68.3    | 63.5  | 4.6          | 34.4        |\n| message with arguments | 100               | 91.6    | 89.4  | 42.0         | 26.9        |\n\n![Setup 3](docs/setup-3.png)\n\n## Run\n\nIn case you want to try benchmark yourself, then you should compile and package all benchmarks first:\n```shell\n./gradlew shadowJar\n```\n\nThen you can run each of them in their proper directory, for example to run *goodforgod-simple-logger* benchmark:\n```shell\njava -jar goodforgod-simple-logger/build/libs/*all.jar\n```\n\nIf you want to suppress logger output to measure raw performance, you should redirect STRERR that logger produce to /dev/null.\n```shell\njava -jar goodforgod-simple-logger/build/libs/*all.jar 2\u003e/dev/null\n```\n\n### Configuration\n\nYou can configure the number of *warmup* and *iterations* with command line arguments, the first argument corresponds to warmups and second is for iterations:\n\nExample below will run 1 warmup and 2 iteration:\n```shell\njava -jar goodforgod-simple-logger/build/libs/*all.jar 1 2\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodforgod%2Fjava-logger-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoodforgod%2Fjava-logger-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodforgod%2Fjava-logger-benchmark/lists"}