Commit Graph

9 Commits

Author SHA1 Message Date
Kobe Housen 8b460bc60f Use make size hint when copying channels in Nick()
70% faster when using a high number of channels

Old performance

```
$ go test ./state -bench=.
goos: linux
goarch: amd64
pkg: github.com/fluffle/goirc/state
cpu: AMD Ryzen Threadripper PRO 3945WX 12-Cores
BenchmarkNickSingleChan-24      15465226                76.35 ns/op
BenchmarkNickManyChan-24            5738            195721 ns/op
PASS
ok      github.com/fluffle/goirc/state  2.433s
```

new performance

```
$ go test ./state -bench=.
goos: linux
goarch: amd64
pkg: github.com/fluffle/goirc/state
cpu: AMD Ryzen Threadripper PRO 3945WX 12-Cores
BenchmarkNickSingleChan-24      15022640                79.13 ns/op
BenchmarkNickManyChan-24           10000            115104 ns/op
PASS
ok      github.com/fluffle/goirc/state  2.456s
```
2023-11-17 12:58:34 +00:00
Alex Bramley 4dd8bc72d5 The great state tracker privatisation 2/3: nicks. 2014-12-31 13:17:28 +00:00
Alex Bramley ca46884c72 Remove embedded logger from state tracker. Hmmmm. 2013-01-23 22:33:01 +00:00
Alex Bramley 69d52270b6 Convert state tracker to use gomock logging for tests. 2011-11-05 12:22:04 +00:00
Alex Bramley fdba74e8c0 Shave the yaks in state's tests. 2011-11-05 06:06:40 +00:00
Alex Bramley 60cd5b975f Test Channel.ParseModes(). 2011-11-03 04:15:12 +00:00
Alex Bramley b88983ceaf Test Nick.ParseModes(). 2011-11-03 03:01:50 +00:00
Alex Bramley 75112d67e2 More nick tests. 2011-10-27 18:43:34 +01:00
Alex Bramley 6ded98b9e5 Moar testing and updates. 2011-10-22 23:58:06 +01:00