{"id":19961199,"url":"https://github.com/yrom/cpp-logging-benchmark","last_synced_at":"2026-07-03T00:32:33.062Z","repository":{"id":180464559,"uuid":"665054280","full_name":"yrom/cpp-logging-benchmark","owner":"yrom","description":"Benchmark some portable C++ Logging libraries","archived":false,"fork":false,"pushed_at":"2023-07-11T16:28:24.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T16:32:29.237Z","etag":null,"topics":["benchmark-suite","cpp","logging"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yrom.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-11T10:33:00.000Z","updated_at":"2023-07-14T07:20:41.000Z","dependencies_parsed_at":"2023-08-22T03:06:11.916Z","dependency_job_id":null,"html_url":"https://github.com/yrom/cpp-logging-benchmark","commit_stats":null,"previous_names":["yrom/cpp-logging-benchmark"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yrom/cpp-logging-benchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yrom%2Fcpp-logging-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yrom%2Fcpp-logging-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yrom%2Fcpp-logging-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yrom%2Fcpp-logging-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yrom","download_url":"https://codeload.github.com/yrom/cpp-logging-benchmark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yrom%2Fcpp-logging-benchmark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35068133,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-02T02:00:06.368Z","response_time":173,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-suite","cpp","logging"],"created_at":"2024-11-13T02:06:39.857Z","updated_at":"2026-07-03T00:32:33.056Z","avatar_url":"https://github.com/yrom.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Benchmark for Portable C++ Logging Libraries\n\nCurrently this project tests the following libraries:\n\n1. [spdlog][spdlog]\n2. [glog][glog]\n\nBenchmarking rule set:\n\n0. logging message in google logging prefix format (`\\[IWEF\\]yyyymmdd hh:mm:ss.uuuuuu threadid file:line\\] msg`)\n1. single-thread \n2. multi-thread\n3. async logging\n4. formatted (or placeholder) log message\n\nNotes:\n\n- The glog does not support _single-thread_ and _async logging_\n- APIs for formatting log messages differ between libraries\n\n### Run benchmark\n\nRun on macOS: \n\n```sh\ncmake -B build -DCMAKE_BUILD_TYPE=Release\ncmake --build ./build --config Release --target run_benchmark\n```\n\nRun on Windows (by [Mingw-w64 toolchain on MSYS2](https://packages.msys2.org/groups/mingw-w64-x86_64-toolchain)): \n\n```sh\ncmake.exe -DCMAKE_C_COMPILER:FILEPATH=C:\\msys64\\mingw64\\bin\\gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\\msys64\\mingw64\\bin\\g++.exe -B build -DCMAKE_BUILD_TYPE=Release\ncmake.exe --build build --config Release --target run_benchmark\n```\n\nRun on Android arm64 device:\n\n```sh\ncmake -B android-build -DCMAKE_BUILD_TYPE=Release \\\n    -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \\\n    -DCMAKE_ANDROID_NDK=$ANDROID_NDK_HOME -DCMAKE_SYSTEM_NAME=Android \\\n    -DANDROID_PLATFORM=android-21 -DANDROID_ABI=arm64-v8a\n\n#... after connecting Android phone via USB\ncmake --build ./android-build --target run_benchmark\n```\n\n### Benchmark result\n\nMacBook Pro (15-inch, 2018)\n\n    Run on (12 X 2600 MHz CPU s)\n    CPU Caches:\n    L1 Data 32 KiB\n    L1 Instruction 32 KiB\n    L2 Unified 256 KiB (x6)\n    L3 Unified 9216 KiB\n    Load Average: 2.59, 2.71, 2.67\n    ------------------------------------------------------------------------------------------------------------------\n    Benchmark                                      Time             CPU   Iterations bytes_per_second items_per_second\n    ------------------------------------------------------------------------------------------------------------------\n    BM_Log/spdlog_st/1024                       3415 ns         3291 ns       432532       296.699M/s        303.82k/s\n    BM_Log/spdlog_st/4096                       7646 ns         7251 ns       162595       538.712M/s        137.91k/s\n    BM_Log/glog_mt/1024/threads:1               9934 ns         9014 ns       136672       108.342M/s       110.942k/s\n    BM_Log/glog_mt/1024/threads:4               7613 ns        14491 ns        99896       67.3897M/s       69.0071k/s\n    BM_Log/glog_mt/1024/threads:6               8022 ns        15763 ns        90672       61.9521M/s        63.439k/s\n    BM_Log/spdlog_mt/1024/threads:1             3232 ns         3129 ns       433094       312.099M/s        319.59k/s\n    BM_Log/spdlog_mt/1024/threads:4             4687 ns         7873 ns       177616       124.042M/s       127.019k/s\n    BM_Log/spdlog_mt/1024/threads:6             3179 ns         7237 ns       188736       134.937M/s       138.176k/s\n    BM_Log/spdlog_async_mt/1024/threads:1       2466 ns         2425 ns       658594       402.726M/s       412.391k/s\n    BM_Log/spdlog_async_mt/1024/threads:4        670 ns         2455 ns       559884       397.724M/s       407.269k/s\n    BM_Log/spdlog_async_mt/1024/threads:6        597 ns         2842 ns       439686       343.635M/s       351.883k/s\n    -------------------------------------------------------------------------------------------------\n    Benchmark                                      Time             CPU   Iterations items_per_second\n    -------------------------------------------------------------------------------------------------\n    BM_Log_FMT/glog_fmt/1024/threads:1          9803 ns         9697 ns       130753       103.121k/s\n    BM_Log_FMT/glog_fmt/1024/threads:4          6988 ns        15587 ns        90660       64.1567k/s\n    BM_Log_FMT/spdlog_fmt/1024/threads:1        3996 ns         3874 ns       351808       258.101k/s\n    BM_Log_FMT/spdlog_fmt/1024/threads:4        3241 ns         7502 ns       185024        133.29k/s\n\n\nVivo Y77 (model:V2219A, Android 12)\n\n    Run on (8 X 2000 MHz CPU s)\n    ***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.\n    ------------------------------------------------------------------------------------------------------------------\n    Benchmark                                      Time             CPU   Iterations bytes_per_second items_per_second\n    ------------------------------------------------------------------------------------------------------------------\n    BM_Log/spdlog_st/1024                       2519 ns         2500 ns       160760       390.611M/s       399.985k/s\n    BM_Log/spdlog_st/4096                       6640 ns         6500 ns        70431       600.926M/s       153.837k/s\n    BM_Log/glog_mt/1024/threads:1              10780 ns        10563 ns        42749       92.4475M/s       94.6663k/s\n    BM_Log/glog_mt/1024/threads:4              60212 ns       147415 ns         2700       6.62456M/s       6.78355k/s\n    BM_Log/glog_mt/1024/threads:6             113007 ns       363736 ns         1758       2.68481M/s       2.74925k/s\n    BM_Log/spdlog_mt/1024/threads:1             2417 ns         2382 ns       181982       409.899M/s       419.737k/s\n    BM_Log/spdlog_mt/1024/threads:4            69655 ns       140792 ns         5432        6.9362M/s       7.10266k/s\n    BM_Log/spdlog_mt/1024/threads:6            75188 ns       169731 ns         2670       5.75357M/s       5.89166k/s\n    BM_Log/spdlog_async_mt/1024/threads:1       1703 ns         1661 ns       254253        587.99M/s       602.102k/s\n    BM_Log/spdlog_async_mt/1024/threads:4       1421 ns         3624 ns       108964       269.453M/s        275.92k/s\n    BM_Log/spdlog_async_mt/1024/threads:6       2031 ns         5178 ns        60000       188.605M/s       193.131k/s\n    -------------------------------------------------------------------------------------------------\n    Benchmark                                      Time             CPU   Iterations items_per_second\n    -------------------------------------------------------------------------------------------------\n    BM_Log_FMT/glog_fmt/1024/threads:1         11804 ns        11566 ns        37387        86.457k/s\n    BM_Log_FMT/glog_fmt/1024/threads:4         63850 ns       176122 ns         3212       5.67789k/s\n    BM_Log_FMT/spdlog_fmt/1024/threads:1        2971 ns         2909 ns       147192       343.764k/s\n    BM_Log_FMT/spdlog_fmt/1024/threads:4       97157 ns       183122 ns         5120       5.46083k/s\n\n[spdlog]: https://github.com/gabime/spdlog\n[glog]: https://github.com/google/glog","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyrom%2Fcpp-logging-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyrom%2Fcpp-logging-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyrom%2Fcpp-logging-benchmark/lists"}