Benchmark - Benchmark of logr implementations

Benchmark of logr implementations

Implementations

  • a function (can bridge to non-structured libraries): funcr
  • log (the Go standard library logger): stdr
  • github.com/google/glog: glogr
  • github.com/sirupsen/logrus: logrusr
  • go.uber.org/zap: zapr
  • github.com/rs/zerolog: zerologr

Benchmark

Lastest benchmark in Github Action

2022-02-07

goos: linux
goarch: amd64
pkg: benchmark
cpu: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz

BenchmarkDiscardInfoOneArg-2         	29582142	        39.83 ns/op	      32 B/op	       1 allocs/op
BenchmarkDiscardInfoSeveralArgs-2    	12446994	        93.78 ns/op	     176 B/op	       2 allocs/op
BenchmarkDiscardV0Info-2             	12744861	        95.27 ns/op	     176 B/op	       2 allocs/op
BenchmarkDiscardV9Info-2             	12594637	        93.64 ns/op	     176 B/op	       2 allocs/op
BenchmarkDiscardError-2              	10781566	       104.0 ns/op	     176 B/op	       2 allocs/op
BenchmarkDiscardWithValues-2         	25914538	        47.78 ns/op	      64 B/op	       1 allocs/op
BenchmarkDiscardWithName-2           	363818114	         3.292 ns/op	       0 B/op	       0 allocs/op
BenchmarkDiscardWithCallDepth-2      	100000000	        10.68 ns/op	       0 B/op	       0 allocs/op

BenchmarkFuncrInfoOneArg-2           	 1318761	       904.0 ns/op	    1152 B/op	       7 allocs/op
BenchmarkFuncrInfoSeveralArgs-2      	  604104	      1998 ns/op	    1448 B/op	      17 allocs/op
BenchmarkFuncrV0Info-2               	  601426	      2000 ns/op	    1448 B/op	      17 allocs/op
BenchmarkFuncrV9Info-2               	11611688	       104.5 ns/op	     176 B/op	       2 allocs/op
BenchmarkFuncrError-2                	  561898	      2175 ns/op	    1480 B/op	      19 allocs/op
BenchmarkFuncrWithValues-2           	 1686696	       660.2 ns/op	     328 B/op	       8 allocs/op
BenchmarkFuncrWithName-2             	14652040	        82.81 ns/op	     160 B/op	       1 allocs/op
BenchmarkFuncrWithCallDepth-2        	14472902	        83.26 ns/op	     160 B/op	       1 allocs/op

BenchmarkStdrInfoOneArg-2            	  697104	      1752 ns/op	    1200 B/op	       8 allocs/op
BenchmarkStdrInfoSeveralArgs-2       	  399481	      2885 ns/op	    1496 B/op	      18 allocs/op
BenchmarkStdrV0Info-2                	  417754	      2877 ns/op	    1496 B/op	      18 allocs/op
BenchmarkStdrV9Info-2                	12667026	        95.66 ns/op	     176 B/op	       2 allocs/op
BenchmarkStdrError-2                 	  400686	      3031 ns/op	    1528 B/op	      20 allocs/op
BenchmarkStdrWithValues-2            	 1852478	       643.4 ns/op	     328 B/op	       8 allocs/op
BenchmarkStdrWithName-2              	14957589	        81.70 ns/op	     160 B/op	       1 allocs/op
BenchmarkStdrWithCallDepth-2         	14793274	        82.72 ns/op	     160 B/op	       1 allocs/op

BenchmarkGlogrInfoOneArg-2           	  379180	      3172 ns/op	    1424 B/op	      11 allocs/op
BenchmarkGlogrInfoSeveralArgs-2      	  276160	      4355 ns/op	    1720 B/op	      21 allocs/op
BenchmarkGlogrV0Info-2               	  270379	      4511 ns/op	    1720 B/op	      21 allocs/op
BenchmarkGlogrV9Info-2               	12271572	        98.11 ns/op	     176 B/op	       2 allocs/op
BenchmarkGlogrError-2                	  269508	      4503 ns/op	    1752 B/op	      23 allocs/op
BenchmarkGlogrWithValues-2           	 1821219	       663.4 ns/op	     312 B/op	       8 allocs/op
BenchmarkGlogrWithName-2             	14607142	        83.01 ns/op	     144 B/op	       1 allocs/op
BenchmarkGlogrWithCallDepth-2        	14942923	        80.98 ns/op	     144 B/op	       1 allocs/op

BenchmarkLogrusrInfoOneArg-2         	  240513	      5025 ns/op	    1752 B/op	      28 allocs/op
BenchmarkLogrusrInfoSeveralArgs-2    	  161313	      7400 ns/op	    2088 B/op	      35 allocs/op
BenchmarkLogrusrV0Info-2             	  164017	      7333 ns/op	    2088 B/op	      35 allocs/op
BenchmarkLogrusrV9Info-2             	12288049	        96.73 ns/op	     176 B/op	       2 allocs/op
BenchmarkLogrusrError-2              	  137755	      8793 ns/op	    2624 B/op	      41 allocs/op
BenchmarkLogrusrWithValues-2         	 1559294	       760.9 ns/op	     960 B/op	       8 allocs/op
BenchmarkLogrusrWithName-2           	 2101682	       570.6 ns/op	     592 B/op	       7 allocs/op
BenchmarkLogrusrWithCallDepth-2      	17443572	        69.27 ns/op	      64 B/op	       1 allocs/op

BenchmarkZaprInfoOneArg-2            	  204626	      5935 ns/op	     712 B/op	      15 allocs/op
BenchmarkZaprInfoSeveralArgs-2       	  168010	      7119 ns/op	    1192 B/op	      17 allocs/op
BenchmarkZaprV0Info-2                	  166699	      7191 ns/op	    1192 B/op	      17 allocs/op
BenchmarkZaprV9Info-2                	11474546	       104.1 ns/op	     176 B/op	       2 allocs/op
BenchmarkZaprError-2                 	  167481	      7264 ns/op	    1320 B/op	      18 allocs/op
BenchmarkZaprWithValues-2            	 1212664	       993.1 ns/op	    1488 B/op	       8 allocs/op
BenchmarkZaprWithName-2              	11181411	       107.3 ns/op	     144 B/op	       2 allocs/op
BenchmarkZaprWithCallDepth-2         	 8214675	       146.8 ns/op	     160 B/op	       3 allocs/op

BenchmarkZerologrInfoOneArg-2        	  596510	      2010 ns/op	     176 B/op	       4 allocs/op
BenchmarkZerologrInfoSeveralArgs-2   	  445365	      2735 ns/op	     336 B/op	       6 allocs/op
BenchmarkZerologrV0Info-2            	  438519	      2765 ns/op	     336 B/op	       6 allocs/op
BenchmarkZerologrV9Info-2            	12310707	        95.97 ns/op	     176 B/op	       2 allocs/op
BenchmarkZerologrError-2             	  439524	      2767 ns/op	     336 B/op	       6 allocs/op
BenchmarkZerologrWithValues-2        	 3002196	       399.0 ns/op	     704 B/op	       4 allocs/op
BenchmarkZerologrWithName-2          	28722273	        42.01 ns/op	      32 B/op	       1 allocs/op
BenchmarkZerologrWithCallDepth-2     	20906972	        56.97 ns/op	      32 B/op	       1 allocs/op
Similar Resources

Simple key-value store abstraction and implementations for Go (Redis, Consul, etcd, bbolt, BadgerDB, LevelDB, Memcached, DynamoDB, S3, PostgreSQL, MongoDB, CockroachDB and many more)

gokv Simple key-value store abstraction and implementations for Go Contents Features Simple interface Implementations Value types Marshal formats Road

Dec 24, 2022

弹弹play 资源搜索节点 API 实现,基于 Cloudflare Workers 或 Golang 的两种实现。 || API implementations for "dandanplay" resource search service.

dandanplay-resource-service API implementations for "dandanplay" resource search service. 弹弹play 资源搜索节点的 API 实现。 提供基于 Cloudflare Workers 和 Golang 的两种实

Dec 5, 2022

Library for multi-armed bandit selection strategies, including efficient deterministic implementations of Thompson sampling and epsilon-greedy.

Library for multi-armed bandit selection strategies, including efficient deterministic implementations of Thompson sampling and epsilon-greedy.

Mab Multi-Armed Bandits Go Library Description Installation Usage Creating a bandit and selecting arms Numerical integration with numint Documentation

Jan 2, 2023

Go package containing implementations of efficient encoding, decoding, and validation APIs.

encoding Go package containing implementations of encoders and decoders for various data formats. Motivation At Segment, we do a lot of marshaling and

Dec 25, 2022

Go filesystem implementations for various URL schemes

hairyhenderson/go-fsimpl This module contains a collection of Go filesystem implementations that can discovered dynamically by URL scheme. All filesys

Dec 28, 2022

NovelAI Research Tool and API implementations in Golang

NovelAI Research Tool - nrt A golang based client with: Minimum Viable Product implementation of a NovelAI service API client covering: /user/login -

Dec 14, 2022

Various implementations of a go-routine safe counter

Shared Counter Implementations Not Safe Counter Mutex Counter Channel Counter Atomic Counter Compare and Swap Counter Compare and Swap Float Counter T

Sep 2, 2022

Implementations of the Coconut signing scheme, cross-compatible between Rust and Go.

Coconut Coconut [paper] is a distributed cryptographic signing scheme providing a high degree of privacy for its users. You can find an overview of ho

Dec 9, 2022

YAML and Golang implementations of common Kubernetes patterns.

Kubernetes Patterns Types Patterns Foundational Patterns Behavioral Patterns Structural Patterns Configuration Patterns Usage To run, simply do go run

Aug 8, 2022

Quick comparison between different Go walk implementations

Quick comparison between different Go walk implementations.

Dec 19, 2022

A project that deals with implementations of a binary tree

Binary Search Tree This is a project that deals with implementations of a binary tree and the following functions. Print Prints the entire tree. Argum

Nov 1, 2021

Go server for handling WebSub, supporting custom implementations of content providers.

Go WebSub Server A Go implementation of a WebSub server. See examples/main.go for a basic example which uses boltdb and a simple publisher. Importing:

Dec 13, 2022

Apollo Federation Gateway v1 implementations by Go

fedeway Apollo Federation Gateway v1 implementations by Go. ⚠️ This product is under development. don't use in production. ⚠️ TODO implements validati

Jan 6, 2023

Common rate-limiter implementations

Overview An example Rate Limiter library used to control the rate that events occur, but these can also be used as thresholds that should replenish ov

Dec 1, 2021

Telemetry interfaces for logs and metrics allowing complete decoupling of instrumentation implementations.

Telemetry This package provides a set of Telemetry interfaces allowing you to completely decouple your libraries and packages from Logging and Metrics

Aug 9, 2022

Vale-compatible implementations of many popular "readability" metrics.

Readability This repository contains a Vale-compatible implementation of many popular "readability" metrics. Getting Started ❗ Readability requires Va

Aug 31, 2022

This repo houses some Golang introductory files, sample codes and implementations

This repo houses some Golang introductory files, sample codes and implementations. I will be updating it as I keep getting a hang of the language.

Aug 27, 2022
A logr LogSink implementation using bytes.Buffer

buflogr A logr LogSink implementation using bytes.Buffer. Usage import ( "bytes" "fmt" "github.com/go-logr/logr" "github.com/tonglil/buflogr" )

Jan 6, 2023
Logger - Some implementations for Logs written in Go

Logger will be a tool for sending logs to different places in your software. Rig

Feb 16, 2022
Benchmark comparison with go-redis
Benchmark comparison with go-redis

Rueidis Benchmark Benchmark comparison with go-redis v8.11.4 Rueidis has higher

Mar 24, 2022
Go-coopsched - A benchmark and playground for Completely Fair Scheduling in Go

A benchmark and playground for Completely Fair Scheduling in Go See https://gith

Nov 16, 2022
A logr LogSink implementation using Zerolog

Zerologr A logr LogSink implementation using Zerolog. Usage import ( "os" "github.com/go-logr/logr" "github.com/hn8/zerologr" "github

Nov 17, 2022
go-logr implementation with pterm
go-logr implementation with pterm

plogr go-logr implementation with pterm Usage See examples Add more colors and levels By default, only level 0 (info) and level 1 (debug) are supporte

Dec 22, 2021
A logr LogSink implementation using bytes.Buffer

buflogr A logr LogSink implementation using bytes.Buffer. Usage import ( "bytes" "fmt" "github.com/go-logr/logr" "github.com/tonglil/buflogr" )

Jan 6, 2023
Redis-benchmark - Simple get, mget and pipelined get benchmark.

redis-benchmark Simple get, mget and pipelined get benchmark. Usage git clone https://github.com/Ali-A-A/redis-benchmark.git cd ./redis-benchmark dock

Dec 31, 2021
Bxd redis benchmark - Redis benchmark tool for golang

使用 redis benchmark 工具, 测试 10 20 50 100 200 1k 5k 字节 value 大小,redis get set 性能。 r

Jan 22, 2022
Go-driver-benchmark - Driver benchmark with golang

We use ClickkHouse for time-series databases, and the driver's performance is ve

Sep 5, 2022