senses2008 / go-logger-benchmark Goto Github PK
View Code? Open in Web Editor NEWGo logger benchmark
Go logger benchmark
测试环境如下:
make|grep 'Benchmark'
BenchmarkLogrusTextFile 2054342 2937 ns/op 472 B/op 14 allocs/op
BenchmarkLogrusTextFile-2 1890679 3186 ns/op 472 B/op 14 allocs/op
BenchmarkLogrusTextFile-4 1829908 3204 ns/op 472 B/op 14 allocs/op
BenchmarkLogrusTextStd time="2020-12-07T17:58:32+08:00" level=info msg="The quick brown fox jumps over the lazy dog"
BenchmarkLogrusTextStd-2 time="2020-12-07T17:58:41+08:00" level=info msg="The quick brown fox jumps over the lazy dog"
BenchmarkLogrusTextStd-4 time="2020-12-07T17:58:52+08:00" level=info msg="The quick brown fox jumps over the lazy dog"
BenchmarkZapTextFile 38814333 153 ns/op 2 B/op 0 allocs/op
BenchmarkZapTextFile-2 62475433 94.7 ns/op 2 B/op 0 allocs/op
BenchmarkZapTextFile-4 100000000 53.4 ns/op 2 B/op 0 allocs/op
BenchmarkZapTextStd {"level":"info","ts":1607335159.9750347,"caller":"go-logger-benchmark/zap_test.go:49","msg":"The quick brown fox jumps over the lazy dog"}
BenchmarkZapTextStd-2 {"level":"info","ts":1607335166.223531,"caller":"go-logger-benchmark/zap_test.go:49","msg":"The quick brown fox jumps over the lazy dog"}
BenchmarkZapTextStd-4 {"level":"info","ts":1607335172.3900282,"caller":"go-logger-benchmark/zap_test.go:49","msg":"The quick brown fox jumps over the lazy dog"}
BenchmarkGologgingTextFile 2633110 2268 ns/op 912 B/op 16 allocs/op
BenchmarkGologgingTextFile-2 3494491 1738 ns/op 912 B/op 16 allocs/op
BenchmarkGologgingTextFile-4 2779741 2165 ns/op 912 B/op 16 allocs/op
BenchmarkGologgingTextStd 2020-12-07T18:00:02+08:00 INFO The quick brown fox jumps over the lazy dog
BenchmarkGologgingTextStd-2 2020-12-07T18:00:11+08:00 INFO The quick brown fox jumps over the lazy dog
BenchmarkGologgingTextStd-4 2020-12-07T18:00:18+08:00 INFO The quick brown fox jumps over the lazy dog
BenchmarkZerologTextFile 4835785 1245 ns/op 0 B/op 0 allocs/op
BenchmarkZerologTextFile-2 4623204 1297 ns/op 0 B/op 0 allocs/op
BenchmarkZerologTextFile-4 4490071 1334 ns/op 0 B/op 0 allocs/op
BenchmarkZerologTextStd {"level":"info","time":"2020-12-07T18:00:50+08:00","message":"The quick brown fox jumps over the lazy dog"}
BenchmarkZerologTextStd-2 {"level":"info","time":"2020-12-07T18:00:57+08:00","message":"The quick brown fox jumps over the lazy dog"}
BenchmarkZerologTextStd-4 {"level":"info","time":"2020-12-07T18:01:05+08:00","message":"The quick brown fox jumps over the lazy dog"}
BenchmarkSeelogTextFile 2552947 2371 ns/op 440 B/op 11 allocs/op
BenchmarkSeelogTextFile-2 2403924 2506 ns/op 440 B/op 11 allocs/op
BenchmarkSeelogTextFile-4 2317423 2573 ns/op 440 B/op 11 allocs/op
BenchmarkSeelogTextStd 18:01:39 Info The quick brown fox jumps over the lazy dog
BenchmarkSeelogTextStd-2 18:01:48 Info The quick brown fox jumps over the lazy dog
BenchmarkSeelogTextStd-4 18:01:57 Info The quick brown fox jumps over the lazy dog
BenchmarkLog15TextFile 1944621 3092 ns/op 928 B/op 14 allocs/op
BenchmarkLog15TextFile-2 1970416 3243 ns/op 928 B/op 14 allocs/op
BenchmarkLog15TextFile-4 1868043 3212 ns/op 928 B/op 14 allocs/op
BenchmarkLog15TextStd t=2020-12-07T18:02:35+0800 lvl=info msg="The quick brown fox jumps over the lazy dog"
BenchmarkLog15TextStd-2 t=2020-12-07T18:02:45+0800 lvl=info msg="The quick brown fox jumps over the lazy dog"
BenchmarkLog15TextStd-4 t=2020-12-07T18:02:55+0800 lvl=info msg="The quick brown fox jumps over the lazy dog"
BenchmarkGokitTextFile 4856694 1231 ns/op 96 B/op 2 allocs/op
BenchmarkGokitTextFile-2 4674361 1289 ns/op 96 B/op 2 allocs/op
BenchmarkGokitTextFile-4 4471422 1339 ns/op 96 B/op 2 allocs/op
BenchmarkGokitTextStd level=info msg="The quick brown fox jumps over the lazy dog"
BenchmarkGokitTextStd-2 level=info msg="The quick brown fox jumps over the lazy dog"
BenchmarkGokitTextStd-4 level=info msg="The quick brown fox jumps over the lazy dog"
BenchmarkLogrusJSONFile 1000000 5145 ns/op 1880 B/op 32 allocs/op
BenchmarkLogrusJSONFile-2 1000000 5499 ns/op 1880 B/op 32 allocs/op
BenchmarkLogrusJSONFile-4 1000000 5658 ns/op 1881 B/op 32 allocs/op
BenchmarkLogrusJSONStd {"high":123.2,"level":"info","low":16,"msg":"The quick brown fox jumps over the lazy dog","rate":"15","time":"2020-12-07T18:04:07+08:00"}
BenchmarkLogrusJSONStd-2 {"high":123.2,"level":"info","low":16,"msg":"The quick brown fox jumps over the lazy dog","rate":"15","time":"2020-12-07T18:04:13+08:00"}
BenchmarkLogrusJSONStd-4 {"high":123.2,"level":"info","low":16,"msg":"The quick brown fox jumps over the lazy dog","rate":"15","time":"2020-12-07T18:04:19+08:00"}
BenchmarkZapJSONFile 25460869 239 ns/op 194 B/op 1 allocs/op
BenchmarkZapJSONFile-2 42357031 142 ns/op 194 B/op 1 allocs/op
BenchmarkZapJSONFile-4 66632858 91.4 ns/op 194 B/op 1 allocs/op
BenchmarkZapJSONStd {"level":"info","ts":1607335484.2841861,"caller":"go-logger-benchmark/zap_test.go:90","msg":"The quick brown fox jumps over the lazy dog","rate":"15","low":16,"high":123.19999694824219}
BenchmarkZapJSONStd-2 {"level":"info","ts":1607335490.2820094,"caller":"go-logger-benchmark/zap_test.go:90","msg":"The quick brown fox jumps over the lazy dog","rate":"15","low":16,"high":123.19999694824219}
BenchmarkZapJSONStd-4 {"level":"info","ts":1607335496.3724594,"caller":"go-logger-benchmark/zap_test.go:90","msg":"The quick brown fox jumps over the lazy dog","rate":"15","low":16,"high":123.19999694824219}
BenchmarkZerologJSONFile 4298863 1397 ns/op 0 B/op 0 allocs/op
BenchmarkZerologJSONFile-2 4041774 1462 ns/op 0 B/op 0 allocs/op
BenchmarkZerologJSONFile-4 4032303 1491 ns/op 0 B/op 0 allocs/op
BenchmarkZerologJSONStd {"level":"info","rate":"15","low":16,"high":123.2,"time":"2020-12-07T18:05:25+08:00","message":"The quick brown fox jumps over the lazy dog"}
BenchmarkZerologJSONStd-2 {"level":"info","rate":"15","low":16,"high":123.2,"time":"2020-12-07T18:05:32+08:00","message":"The quick brown fox jumps over the lazy dog"}
BenchmarkZerologJSONStd-4 {"level":"info","rate":"15","low":16,"high":123.2,"time":"2020-12-07T18:05:41+08:00","message":"The quick brown fox jumps over the lazy dog"}
BenchmarkLog15JSONFile 976544 5998 ns/op 2032 B/op 30 allocs/op
BenchmarkLog15JSONFile-2 953871 6351 ns/op 2032 B/op 30 allocs/op
BenchmarkLog15JSONFile-4 891823 6568 ns/op 2032 B/op 30 allocs/op
BenchmarkLog15JSONStd {"high":123.2,"low":16,"lvl":"info","msg":"The quick brown fox jumps over the lazy dog","rate":15,"t":"2020-12-07T18:06:07.248830113+08:00"}
BenchmarkLog15JSONStd-2 {"high":123.2,"low":16,"lvl":"info","msg":"The quick brown fox jumps over the lazy dog","rate":15,"t":"2020-12-07T18:06:13.654503898+08:00"}
BenchmarkLog15JSONStd-4 {"high":123.2,"low":16,"lvl":"info","msg":"The quick brown fox jumps over the lazy dog","rate":15,"t":"2020-12-07T18:06:19.622031189+08:00"}
BenchmarkGokitJSONFile 2956881 2009 ns/op 298 B/op 5 allocs/op
BenchmarkGokitJSONFile-2 2833911 2134 ns/op 298 B/op 5 allocs/op
BenchmarkGokitJSONFile-4 2820464 2106 ns/op 298 B/op 5 allocs/op
BenchmarkGokitJSONStd level=info msg="The quick brown fox jumps over the lazy dog" rate=15 low=16 high=123.2
BenchmarkGokitJSONStd-2 level=info msg="The quick brown fox jumps over the lazy dog" rate=15 low=16 high=123.2
BenchmarkGokitJSONStd-4 level=info msg="The quick brown fox jumps over the lazy dog" rate=15 low=16 high=123.2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.