News for hackers. Stuff that matters.
Re:Interface Dispatch (2018) by Insanity on Thursday April 18, 2019 @09:05AM (#19690666)
Well the code is the same for all of them (but when using a bool map we assign true instead of empty struct). So we run this code inside a benchmarking function:

      m := map[int]interface{}
      // or m := map[int]struct{}
      for i := 0; i < t.N; i++ {
           m[i] = struct{}{}
      }
edit: fix code.
Re:Interface Dispatch (2018) by wyufro on Thursday April 18, 2019 @09:56AM (#19691018)
I'm speculating, but sizeof(bool) == 1, sizeof(struct{}) == 0 and sizeof(interface{}) == 8, so might be as simple as that.

https://play.golang.org/p/5acy87JLD3i

Re:Interface Dispatch (2018) by Insanity on Thursday April 18, 2019 @10:42AM (#19691354)
Yup that well could be it!