{"id":38852421,"url":"https://github.com/globusdigital/logbench","last_synced_at":"2026-01-17T14:13:49.215Z","repository":{"id":47789022,"uuid":"220487080","full_name":"globusdigital/logbench","owner":"globusdigital","description":"Structured JSON logging Go libraries benchmark","archived":false,"fork":false,"pushed_at":"2023-03-07T08:36:08.000Z","size":558,"stargazers_count":22,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-19T03:08:22.351Z","etag":null,"topics":["benchmark","go","golang","logging","zap","zerolog"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/globusdigital.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":"2019-11-08T14:47:37.000Z","updated_at":"2023-08-28T16:35:12.000Z","dependencies_parsed_at":"2024-06-19T02:54:06.131Z","dependency_job_id":"299c063d-5010-4d45-8ec8-f7a7ad5f54b2","html_url":"https://github.com/globusdigital/logbench","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/globusdigital/logbench","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globusdigital%2Flogbench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globusdigital%2Flogbench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globusdigital%2Flogbench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globusdigital%2Flogbench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/globusdigital","download_url":"https://codeload.github.com/globusdigital/logbench/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globusdigital%2Flogbench/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28509941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","go","golang","logging","zap","zerolog"],"created_at":"2026-01-17T14:13:48.498Z","updated_at":"2026-01-17T14:13:49.203Z","avatar_url":"https://github.com/globusdigital.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://goreportcard.com/report/github.com/globusdigital/logbench\"\u003e\n  \u003cimg src=\"https://goreportcard.com/badge/github.com/globusdigital/logbench\" alt=\"GoReportCard\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://travis-ci.org/globusdigital/logbench\"\u003e\n    \u003cimg src=\"https://travis-ci.org/globusdigital/logbench.svg?branch=master\" alt=\"Travis CI: build status\"\u003e\n\u003c/a\u003e\n\u003ca href='https://coveralls.io/github/globusdigital/logbench'\u003e\n    \u003cimg src='https://coveralls.io/repos/github/globusdigital/logbench/badge.svg' alt='Coverage Status' /\u003e\n\u003c/a\u003e\n\n\u003ch2\u003e\n  \u003cspan\u003eGo - Structured Logging Benchmark\u003c/span\u003e\n  \u003cbr\u003e\n  \u003csub\u003eby \u003ca href=\"https://globus.ch\"\u003eMagazine zum Globus\u003c/a\u003e\u003c/sub\u003e\n\u003c/h2\u003e\n\nA structured JSON logging performance benchmark providing realistic performance metrics for the latest versions of:\n- [sirupsen/logrus](https://github.com/sirupsen/logrus)\n- [uber/zap](https://github.com/uber-go/zap)\n- [rs/zerolog](https://github.com/rs/zerolog)\n\nPerformance is measured by the following main criteria:\n- `total alloc` - Total size of allocated memory.\n- `num-gc` - Total number of GC cycles.\n- `mallocs` - Total number of allocated heap objects.\n- `total pause` - Total duration of GC pauses.\n- Average and total time of execution (by operation).\n\n\u003cbr\u003e\n\n![Benchmark Results](https://github.com/globusdigital/logbench/blob/master/results_graphs.png?raw=true)\n_i7-8569U @ 2.80GHz_\n\n## Getting started\n\n1. Install the benchmark:\n```\ngo get github.com/globusdigital/logbench\n```\n\n2. Run it:\n```\nlogbench -w 8 -t 1_000_000 -o_all -l zerolog\n```\n\n- `-w \u003cnum\u003e`: defines the number of concurrently writing goroutines.\n- `-l \u003clogger\u003e`: enables a logger.\nYou can enable multiple loggers by specifying multiple flags: `-l zerolog -l zap -l logrus`.\n- `-o \u003coperation\u003e`: enables an operation.\nYou can enable multiple operations by specifying multiple flags: `-o info -o error -o info_with_3`.\n- `-t \u003cnum\u003e`: defines the number of logs to be written for each operation.\n- `-o_all`: enables all operations ignoring all specified `-o` flags\n- `-memprof \u003cpath\u003e`: specifies the output file path for the memory profile (disabled when not set)\n- `-mi \u003cduration\u003e`: memory inspection interval\n\n## How-to\n### Adding a new logger to the benchmark\n- 1. Define the logger in a sub-package.\n- 2. Provide a `Setup() benchmark.Setup` function in your logger's sub-package.\n- 3. Implement all benchmark operations:\n  - `FnInfo func(msg string)`\n  - `FnInfoFmt func(msg string, data int)`\n  - `FnError func(msg string)`\n  - `FnInfoWithErrorStack func(msg string, err error)`\n  - `FnInfoWith3 func(msg string, fields *benchmark.Fields3)`\n  - `FnInfoWith10 func(msg string, fields *benchmark.Fields10)`\n  - `FnInfoWith10Exist func(msg string)`\n- 4. Add your setup to [`setups`](https://github.com/globusdigital/logbench/blob/eff659cfb1eb06b1d139db6735b2b2ce6944632c/main.go#L21).\n- 5. Run the tests with `go test -v -race ./...` and make sure everything's working.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobusdigital%2Flogbench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglobusdigital%2Flogbench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobusdigital%2Flogbench/lists"}