Exemplo n.º 1
0
func BenchmarkFive(b *testing.B) {
	f := stream.FilterFunc(func(arg stream.Arg) error {
		for s := range arg.In {
			arg.Out <- s
		}
		return nil
	})
	stream.Run(stream.Repeat("", b.N), f, f, f, f)
}
Exemplo n.º 2
0
func BenchmarkWrite(b *testing.B) {
	f, err := os.Create("/dev/null")
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
	stream.Run(
		stream.Repeat("hello", b.N),
		stream.WriteLines(f),
	)
}
Exemplo n.º 3
0
func BenchmarkXargs1(b *testing.B) {
	stream.Run(
		stream.Repeat("hello", b.N),
		stream.Xargs("true").LimitArgs(1),
	)
}
Exemplo n.º 4
0
func BenchmarkCmd(b *testing.B) {
	stream.Run(
		stream.Repeat("hello", b.N),
		stream.Command("cat"),
	)
}
Exemplo n.º 5
0
func BenchmarkSort3(b *testing.B) {
	stream.Run(
		stream.Repeat("the 3 musketeers", b.N),
		stream.Sort().Num(2).Text(1).Text(3),
	)
}
Exemplo n.º 6
0
func BenchmarkSort(b *testing.B) {
	stream.Run(
		stream.Repeat("hello", b.N),
		stream.Sort(),
	)
}
Exemplo n.º 7
0
func BenchmarkSample(b *testing.B) {
	stream.Run(
		stream.Repeat("hello", b.N),
		stream.Sample(10),
	)
}
Exemplo n.º 8
0
func BenchmarkSingle(b *testing.B) {
	stream.Run(stream.Repeat("", b.N))
}