title: Golang: make slice performance
body: <p>Why these benchmark results are so different?</p>
  
  <pre><code>func Benchmark1(b *testing.B) {
      for n := 0; n &lt; b.N; n++ {
          _ = make([]byte, 8)
      }
  }
  
  func Benchmark2(b *testing.B) {
      length := 1
      for n := 0; n &lt; b.N; n++ {
          _ = make([]byte, 7+length)
      }
  }
  </code></pre>
  
  <p>Benchmark results:</p>
  
  <pre><code>Benchmark1-8                    500000000            3.37 ns/op
  Benchmark2-8                    30000000            50.6 ns/op
  </code></pre>