mozilla/rust — pull request #11497 by huonw (2014-01-12 12:35:07+00:00)
Title: Re-add internal iterators to std::trie for performance reasons

The external iterators have a significant amount of overhead---having to
maintain and index into a heap allocated stack---which means a simple
internal iterator can be much faster.

bench_each_large ... bench: 30907 ns/iter (+/- 3503)
bench_iter_large ... bench: 43187 ns/iter (+/- 3082)

bench_each_small ... bench: 333 ns/iter (+/- 170)
bench_iter_small ... bench: 618 ns/iter (+/- 288)

Despite being slower, the external iterators have their place: they are
significantly more composable.

Also, removes `.each_{key,value}_reverse` as an offering to
placate the gods of external iterators for my heinous sin of adding
the new internal ones.