Add benchmark for adding a torrent with a lot of pieces
This commit is contained in:
parent
b2b290a589
commit
d8cf0f1e34
|
@ -388,3 +388,19 @@ func TestCompletedPieceWrongSize(t *testing.T) {
|
|||
}
|
||||
defer tt.Drop()
|
||||
}
|
||||
|
||||
func BenchmarkAddLargeTorrent(b *testing.B) {
|
||||
cfg := TestingConfig
|
||||
cfg.DisableTCP = true
|
||||
cfg.DisableUTP = true
|
||||
cfg.ListenAddr = "redonk"
|
||||
cl, _ := NewClient(&cfg)
|
||||
defer cl.Close()
|
||||
for range iter.N(b.N) {
|
||||
t, err := cl.AddTorrentFromFile("testdata/bootstrap.dat.torrent")
|
||||
if err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
t.Drop()
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue