MCPcopy
hub / github.com/github/git-sizer / BenchmarkTenFunctions

Function BenchmarkTenFunctions

internal/pipe/pipeline_test.go:826–848  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

824}
825
826func BenchmarkTenFunctions(b *testing.B) {
827 ctx := context.Background()
828
829 for i := 0; i < b.N; i++ {
830 p := pipe.New()
831 p.Add(
832 pipe.Println("hello world"),
833 pipe.Function("copy1", catFn),
834 pipe.Function("copy2", catFn),
835 pipe.Function("copy3", catFn),
836 pipe.Function("copy4", catFn),
837 pipe.Function("copy5", catFn),
838 pipe.Function("copy6", catFn),
839 pipe.Function("copy7", catFn),
840 pipe.Function("copy8", catFn),
841 pipe.Function("copy9", catFn),
842 )
843 out, err := p.Output(ctx)
844 if assert.NoError(b, err) {
845 assert.EqualValues(b, "hello world\n", out)
846 }
847 }
848}
849
850func BenchmarkTenMixedStages(b *testing.B) {
851 ctx := context.Background()

Callers

nothing calls this directly

Calls 5

NewFunction · 0.92
PrintlnFunction · 0.92
FunctionFunction · 0.92
OutputMethod · 0.80
AddMethod · 0.65

Tested by

no test coverage detected