mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 20:55:28 +00:00
test(flow): adds BenchmarkGetJSRuntime
Signed-off-by: Dwi Siswanto <git@dw1.io>
This commit is contained in:
parent
b8631c5243
commit
7f2adbe43a
19
pkg/tmplexec/flow/vm_benchmark_test.go
Normal file
19
pkg/tmplexec/flow/vm_benchmark_test.go
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
package flow_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/projectdiscovery/nuclei/v3/pkg/tmplexec/flow"
|
||||||
|
"github.com/projectdiscovery/nuclei/v3/pkg/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func BenchmarkGetJSRuntime(b *testing.B) {
|
||||||
|
opts := types.DefaultOptions()
|
||||||
|
|
||||||
|
b.ResetTimer()
|
||||||
|
b.ReportAllocs()
|
||||||
|
for i := 0; i < b.N; i++ {
|
||||||
|
runtime := flow.GetJSRuntime(opts)
|
||||||
|
flow.PutJSRuntime(runtime)
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user