MCPcopy Create free account
hub / github.com/evilsocket/sum / BenchmarkServiceRunWithCompression

Function BenchmarkServiceRunWithCompression

service/service_benchmark_test.go:42–64  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

40}
41
42func BenchmarkServiceRunWithCompression(b *testing.B) {
43 bak := testOracle.Code
44
45 testOracle.Code = "function findReasonsToLive(){ return " + bigString + "; }"
46 defer func() {
47 testOracle.Code = bak
48 }()
49
50 setup(b, true, true)
51 defer teardown(b)
52
53 svc, err := New(testFolder, "", "")
54 if err != nil {
55 b.Fatal(err)
56 }
57
58 ctx := context.TODO()
59 for i := 0; i < b.N; i++ {
60 if _, err := svc.Run(ctx, &testCall); err != nil {
61 b.Fatal(err)
62 }
63 }
64}

Callers

nothing calls this directly

Calls 4

setupFunction · 0.85
teardownFunction · 0.85
NewFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected