yanatan16/itertools — pull request #1 by damienklinnert (2014-06-09 17:28:46+00:00)
Title: Add benchmarks for filter, map and reduce

Running the included benchmarks with `go test -bench .` yields the following results on my machine:

```
BenchmarkFilter	200000	41188 ns/op
BenchmarkNoFilter	5000000	640 ns/op
BenchmarkMap	10000	108577 ns/op
BenchmarkNoMap	10000000	321 ns/op
BenchmarkReduce	1000000	1962 ns/op
BenchmarkNoReduce	100000000	22.0 ns/op
```

Which means:

Filter: 64x slower
Map: 338x slower
Reduce: 89x slower

I like the convenience this package gives, but I think it should be transparent how much slower this approach is, in order to make the right decision.