Skip to content

Commit 86e7b28

Browse files
committed
update benchmarks, add string benchmark
1 parent 67ae613 commit 86e7b28

File tree

2 files changed

+56
-43
lines changed

2 files changed

+56
-43
lines changed

README.md

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,49 @@
77
## Benchmarks
88

99
```
10-
benchmark iter time/iter bytes alloc allocs
11-
--------- ---- --------- ----------- ------
12-
BenchmarkParseSimple/jakebailey/irc-4 10000000 130.00 ns/op 32 B/op 1 allocs/op
13-
BenchmarkParseSimple/jakebailey/ircold-4 10000000 223.00 ns/op 144 B/op 3 allocs/op
14-
BenchmarkParseSimple/fluffle/goirc/client-4 5000000 367.00 ns/op 288 B/op 4 allocs/op
15-
BenchmarkParseSimple/sorcix/irc-4 10000000 223.00 ns/op 144 B/op 3 allocs/op
16-
BenchmarkParseSimple/thoj/go-ircevent-4 5000000 356.00 ns/op 256 B/op 4 allocs/op
17-
BenchmarkParseSimple/goshuirc/irc-go/ircmsg-4 2000000 659.00 ns/op 336 B/op 11 allocs/op
18-
BenchmarkParseSimple/gempir/go-twitch-irc-4 10000000 192.00 ns/op 400 B/op 3 allocs/op
19-
20-
BenchmarkParseTwitch/jakebailey/irc-4 1000000 1364.00 ns/op 1234 B/op 3 allocs/op
21-
BenchmarkParseTwitch/jakebailey/ircold-4 300000 5689.00 ns/op 4015 B/op 64 allocs/op
22-
BenchmarkParseTwitch/fluffle/goirc/client-4 300000 5894.00 ns/op 4159 B/op 65 allocs/op
23-
BenchmarkParseTwitch/sorcix/irc-4 300000 5755.00 ns/op 4015 B/op 64 allocs/op
24-
BenchmarkParseTwitch/thoj/go-ircevent-4 300000 4700.00 ns/op 3071 B/op 23 allocs/op
25-
BenchmarkParseTwitch/goshuirc/irc-go/ircmsg-4 200000 11177.00 ns/op 5873 B/op 155 allocs/op
26-
BenchmarkParseTwitch/gempir/go-twitch-irc-4 300000 4789.00 ns/op 2601 B/op 34 allocs/op
27-
28-
BenchmarkParseEscaping/jakebailey/irc-4 500000 2608.00 ns/op 1553 B/op 9 allocs/op
29-
BenchmarkParseEscaping/jakebailey/ircold-4 200000 7874.00 ns/op 4877 B/op 84 allocs/op
30-
BenchmarkParseEscaping/fluffle/goirc/client-4 200000 8012.00 ns/op 4958 B/op 84 allocs/op
31-
BenchmarkParseEscaping/sorcix/irc-4 200000 7886.00 ns/op 4877 B/op 84 allocs/op
32-
BenchmarkParseEscaping/thoj/go-ircevent-4 200000 6617.00 ns/op 3549 B/op 31 allocs/op
33-
BenchmarkParseEscaping/goshuirc/irc-go/ircmsg-4 100000 17454.00 ns/op 10230 B/op 246 allocs/op
34-
BenchmarkParseEscaping/gempir/go-twitch-irc-4 300000 5414.00 ns/op 3629 B/op 30 allocs/op
35-
36-
BenchmarkEncodeSimple/jakebailey/irc-4 10000000 118.00 ns/op 48 B/op 1 allocs/op
37-
BenchmarkEncodeSimple/jakebailey/irc_WriteTo-4 20000000 100.00 ns/op 0 B/op 0 allocs/op
38-
BenchmarkEncodeSimple/jakebailey/ircold-4 10000000 138.00 ns/op 112 B/op 1 allocs/op
39-
BenchmarkEncodeSimple/sorcix/irc-4 10000000 139.00 ns/op 112 B/op 1 allocs/op
40-
BenchmarkEncodeSimple/goshuirc/irc-go/ircmsg-4 10000000 155.00 ns/op 112 B/op 1 allocs/op
41-
42-
BenchmarkEncodeTwitch/jakebailey/irc-4 2000000 842.00 ns/op 352 B/op 1 allocs/op
43-
BenchmarkEncodeTwitch/jakebailey/irc_WriteTo-4 2000000 739.00 ns/op 0 B/op 0 allocs/op
44-
BenchmarkEncodeTwitch/jakebailey/ircold-4 1000000 1224.00 ns/op 1190 B/op 3 allocs/op
45-
BenchmarkEncodeTwitch/sorcix/irc-4 1000000 1220.00 ns/op 1178 B/op 3 allocs/op
46-
BenchmarkEncodeTwitch/goshuirc/irc-go/ircmsg-4 1000000 1671.00 ns/op 1244 B/op 4 allocs/op
47-
48-
BenchmarkEncodeEscaping/jakebailey/irc-4 1000000 1375.00 ns/op 480 B/op 1 allocs/op
49-
BenchmarkEncodeEscaping/jakebailey/irc_WriteTo-4 1000000 1251.00 ns/op 0 B/op 0 allocs/op
50-
BenchmarkEncodeEscaping/jakebailey/ircold-4 1000000 1370.00 ns/op 1365 B/op 4 allocs/op
51-
BenchmarkEncodeEscaping/sorcix/irc-4 1000000 1385.00 ns/op 1306 B/op 4 allocs/op
52-
BenchmarkEncodeEscaping/goshuirc/irc-go/ircmsg-4 500000 2415.00 ns/op 1612 B/op 8 allocs/op
10+
benchmark iter time/iter bytes alloc allocs
11+
--------- ---- --------- ----------- ------
12+
BenchmarkParseSimple/jakebailey/irc-4 20000000 102.00 ns/op 16 B/op 1 allocs/op
13+
BenchmarkParseSimple/jakebailey/ircold-4 5000000 221.00 ns/op 144 B/op 3 allocs/op
14+
BenchmarkParseSimple/fluffle/goirc/client-4 5000000 348.00 ns/op 288 B/op 4 allocs/op
15+
BenchmarkParseSimple/sorcix/irc-4 10000000 206.00 ns/op 144 B/op 3 allocs/op
16+
BenchmarkParseSimple/thoj/go-ircevent-4 5000000 339.00 ns/op 256 B/op 4 allocs/op
17+
BenchmarkParseSimple/goshuirc/irc-go/ircmsg-4 10000000 161.00 ns/op 48 B/op 2 allocs/op
18+
BenchmarkParseSimple/gempir/go-twitch-irc-4 10000000 192.00 ns/op 448 B/op 3 allocs/op
19+
20+
BenchmarkParseTwitch/jakebailey/irc-4 1000000 1270.00 ns/op 1218 B/op 3 allocs/op
21+
BenchmarkParseTwitch/jakebailey/ircold-4 300000 5661.00 ns/op 4015 B/op 64 allocs/op
22+
BenchmarkParseTwitch/fluffle/goirc/client-4 300000 5849.00 ns/op 4159 B/op 65 allocs/op
23+
BenchmarkParseTwitch/sorcix/irc-4 300000 5700.00 ns/op 4015 B/op 64 allocs/op
24+
BenchmarkParseTwitch/thoj/go-ircevent-4 300000 4535.00 ns/op 3071 B/op 23 allocs/op
25+
BenchmarkParseTwitch/goshuirc/irc-go/ircmsg-4 1000000 2222.00 ns/op 2191 B/op 6 allocs/op
26+
BenchmarkParseTwitch/gempir/go-twitch-irc-4 300000 5562.00 ns/op 3879 B/op 35 allocs/op
27+
28+
BenchmarkParseEscaping/jakebailey/irc-4 500000 2544.00 ns/op 1553 B/op 9 allocs/op
29+
BenchmarkParseEscaping/jakebailey/ircold-4 200000 7807.00 ns/op 4878 B/op 84 allocs/op
30+
BenchmarkParseEscaping/fluffle/goirc/client-4 200000 7915.00 ns/op 4957 B/op 84 allocs/op
31+
BenchmarkParseEscaping/sorcix/irc-4 200000 7817.00 ns/op 4878 B/op 84 allocs/op
32+
BenchmarkParseEscaping/thoj/go-ircevent-4 200000 6294.00 ns/op 3550 B/op 31 allocs/op
33+
BenchmarkParseEscaping/goshuirc/irc-go/ircmsg-4 500000 3083.00 ns/op 2462 B/op 9 allocs/op
34+
BenchmarkParseEscaping/gempir/go-twitch-irc-4 300000 5242.00 ns/op 3678 B/op 30 allocs/op
35+
36+
BenchmarkEncodeSimple/jakebailey/irc-4 10000000 119.00 ns/op 48 B/op 1 allocs/op
37+
BenchmarkEncodeSimple/jakebailey/irc_WriteTo-4 20000000 99.20 ns/op 0 B/op 0 allocs/op
38+
BenchmarkEncodeSimple/jakebailey/ircold-4 20000000 103.00 ns/op 64 B/op 1 allocs/op
39+
BenchmarkEncodeSimple/sorcix/irc-4 20000000 104.00 ns/op 64 B/op 1 allocs/op
40+
BenchmarkEncodeSimple/goshuirc/irc-go/ircmsg-4 20000000 104.00 ns/op 64 B/op 1 allocs/op
41+
42+
BenchmarkEncodeTwitch/jakebailey/irc-4 2000000 895.00 ns/op 352 B/op 1 allocs/op
43+
BenchmarkEncodeTwitch/jakebailey/irc_WriteTo-4 2000000 800.00 ns/op 0 B/op 0 allocs/op
44+
BenchmarkEncodeTwitch/jakebailey/ircold-4 1000000 1192.00 ns/op 1184 B/op 3 allocs/op
45+
BenchmarkEncodeTwitch/sorcix/irc-4 1000000 1219.00 ns/op 1151 B/op 3 allocs/op
46+
BenchmarkEncodeTwitch/goshuirc/irc-go/ircmsg-4 1000000 1489.00 ns/op 1118 B/op 3 allocs/op
47+
48+
BenchmarkEncodeEscaping/jakebailey/irc-4 1000000 1456.00 ns/op 480 B/op 1 allocs/op
49+
BenchmarkEncodeEscaping/jakebailey/irc_WriteTo-4 1000000 1324.00 ns/op 0 B/op 0 allocs/op
50+
BenchmarkEncodeEscaping/jakebailey/ircold-4 1000000 1347.00 ns/op 1335 B/op 4 allocs/op
51+
BenchmarkEncodeEscaping/sorcix/irc-4 1000000 1387.00 ns/op 1426 B/op 4 allocs/op
52+
BenchmarkEncodeEscaping/goshuirc/irc-go/ircmsg-4 1000000 2202.00 ns/op 1584 B/op 7 allocs/op
5353
```
5454

5555
See http://github.com/jakebailey/irc-benchmarks for more info.

message_encode_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,16 @@ func BenchmarkEncodeBytes(b *testing.B) {
104104
m.Bytes()
105105
}
106106
}
107+
108+
func BenchmarkEncodeString(b *testing.B) {
109+
m, err := ParseMessage(rawTwitch)
110+
if err != nil {
111+
b.Fatal(err)
112+
}
113+
114+
b.SetBytes(int64(len(rawTwitch)))
115+
b.ResetTimer()
116+
for i := 0; i < b.N; i++ {
117+
m.String()
118+
}
119+
}

0 commit comments

Comments
 (0)