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