Browse Source

Delete test of premature optimization

I suspect this is worth some perf, but it's probably not enough for us
to care. More importantly, it breaks in Go 1.5, where a recent
optimization made sync.WaitGroup much smaller.
Carl Jackson 11 years ago
parent
commit
51390a05d1
1 changed files with 0 additions and 21 deletions
  1. +0
    -21
      graceful/listener/shard_test.go

+ 0
- 21
graceful/listener/shard_test.go View File

@ -1,21 +0,0 @@
// +build amd64
package listener
import (
"testing"
"unsafe"
)
// We pack shards together in an array, but we don't want them packed too
// closely, since we want to give each shard a dedicated CPU cache line. This
// test checks this property for x64 (which has a 64-byte cache line), which
// probably covers the majority of deployments.
//
// As always, this is probably a premature optimization.
func TestShardSize(t *testing.T) {
s := unsafe.Sizeof(shard{})
if s < 64 {
t.Errorf("sizeof(shard) = %d; expected >64", s)
}
}

Loading…
Cancel
Save