diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-12-13 11:25:10 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-12-17 11:39:14 +0100 |
| commit | 2b4927e6ce74a5a6f71c647af9ef765f81ba2bff (patch) | |
| tree | 157ad77fb8b7035de79d0c64372a0953b5e7c2aa | |
| parent | f2d5384a68f4d7b18bf2917e593f24a5fd5e383f (diff) | |
prog: add benchmark for Mutate
| -rw-r--r-- | prog/mutation_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/prog/mutation_test.go b/prog/mutation_test.go index 418ca3659..771c6c143 100644 --- a/prog/mutation_test.go +++ b/prog/mutation_test.go @@ -331,3 +331,23 @@ func TestMinimizeCallIndex(t *testing.T) { } } } + +func BenchmarkMutate(b *testing.B) { + olddebug := debug + debug = false + defer func() { debug = olddebug }() + target, err := GetTarget("linux", "amd64") + if err != nil { + b.Fatal(err) + } + prios := target.CalculatePriorities(nil) + ct := target.BuildChoiceTable(prios, nil) + const progLen = 30 + p := target.Generate(rand.NewSource(0), progLen, nil) + b.RunParallel(func(pb *testing.PB) { + rs := rand.NewSource(0) + for pb.Next() { + p.Clone().Mutate(rs, progLen, ct, nil) + } + }) +} |
