google/quiver-dart — pull request #74 by ovangle (2014-01-12 06:13:20+00:00)
Title: Additions to quiver.iterables

Here are a few additions I've added to the iterables library. Most of them should be generally useful and they're all benchmarked to be faster than the equivalent standard library implementation (where one exists).

A couple of things to note:
* I couldn't improve on sort, but Iterable.sort is missing from the iterable interface.so I kept the function in there with the reference implementation because it cuts down a few lines of code wherever it's useful (casting to a list and then sorting).
* The benchmark harness can be removed if you don't want it in there, but I feel since quiver is aiming to be a low level library and replace a lot of the stdlib functions, a benchmark suite would be a useful addition. I've only added benchmarks for the code that I've modified, because performance was a key issue for most of it.
* After benchmarking, I removed the ternary operator from the "current" property of the range iterator. It only improves the implementation slightly (~ 200 milliseconds on a 50,000 item range loop), but because it is used almost everywhere by people who prefer the python style `for` to the C style `for`, it makes a difference.