|
|
|
|
|
by Insanity
2622 days ago
|
|
Speaking of interfaces in Go, can anyone explain this particular result?
We've done a benchmark recently at work to test which way we would best represent a set. (Linux, go1.12) map[string]bool
map[string]struct{}
map[string]interface{} // where we put an empty struct in it.
results: BenchmarkBoolSet-4 5886572 223 ns/op 39 B/op 0 allocs/op
BenchmarkStructSet-4 6716685 206 ns/op 32 B/op 0 allocs/op
BenchmarkInterfaceSet-4 4299072 313 ns/op 115 B/op 0 allocs/op
(I'm aware this is a bit of a tangent to TFA) |
|