(b *testing.B)
| 179 | } |
| 180 | |
| 181 | func BenchmarkPutSGWithHash1MParallel(b *testing.B) { |
| 182 | b.RunParallel(func(pb *testing.PB) { |
| 183 | mmsa, _ := memsys.NewMMSA("tutils") |
| 184 | sgl := mmsa.NewSGL(cos.MiB) |
| 185 | defer func() { |
| 186 | mmsa.Terminate(false) |
| 187 | }() |
| 188 | |
| 189 | for pb.Next() { |
| 190 | err := putSG(sgl, 1024*1024, cos.ChecksumXXHash) |
| 191 | if err != nil { |
| 192 | b.Fatal(err) |
| 193 | } |
| 194 | } |
| 195 | }) |
| 196 | } |
| 197 | |
| 198 | func TestMain(m *testing.M) { |
| 199 | srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |