Example #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)
}
Example #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),
	)
}
Example #3
0
func BenchmarkXargs1(b *testing.B) {
	stream.Run(
		stream.Repeat("hello", b.N),
		stream.Xargs("true").LimitArgs(1),
	)
}
Example #4
0
func BenchmarkCmd(b *testing.B) {
	stream.Run(
		stream.Repeat("hello", b.N),
		stream.Command("cat"),
	)
}
Example #5
0
func BenchmarkSort3(b *testing.B) {
	stream.Run(
		stream.Repeat("the 3 musketeers", b.N),
		stream.Sort().Num(2).Text(1).Text(3),
	)
}
Example #6
0
func BenchmarkSort(b *testing.B) {
	stream.Run(
		stream.Repeat("hello", b.N),
		stream.Sort(),
	)
}
Example #7
0
func BenchmarkSample(b *testing.B) {
	stream.Run(
		stream.Repeat("hello", b.N),
		stream.Sample(10),
	)
}
Example #8
0
func BenchmarkSingle(b *testing.B) {
	stream.Run(stream.Repeat("", b.N))
}