MCPcopy Create free account
hub / github.com/astercloud/aster / BenchmarkTransform

Function BenchmarkTransform

pkg/stream/stream_test.go:465–478  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

463}
464
465func BenchmarkTransform(b *testing.B) {
466 data := make([]int, 1000)
467 for i := range data {
468 data[i] = i
469 }
470
471 for b.Loop() {
472 reader := FromSlice(data)
473 transformed := Transform(reader, func(v int) (int, error) {
474 return v * 2, nil
475 })
476 _, _ = transformed.Collect()
477 }
478}

Callers

nothing calls this directly

Calls 3

FromSliceFunction · 0.85
TransformFunction · 0.85
CollectMethod · 0.80

Tested by

no test coverage detected