Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions exercises/practice/hamming/.approaches/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,6 @@ For more information, check the [`IntStream` with `reduce()` approach][approach-
Since benchmarking with the [Java Microbenchmark Harness][jmh] is currently outside the scope of this document,
the choice between the various approaches can be made by perceived readability.

Of the `IntStream` approaches, the `reduce()` approach likely might be fastest, as it is only one iteration
instead of an iteration for `filter()` or `map()` and another iteration for `count()` or `sum()`.

The `for` loop may also be fast, but it leaves a mutable member variable for the distance, instead of one marked [`final`][final].

[for]: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/for.html
[intstream]: https://docs.oracle.com/javase/8/docs/api/java/util/stream/IntStream.html
[filter]: https://docs.oracle.com/javase/8/docs/api/java/util/stream/IntStream.html#filter-java.util.function.IntPredicate-
Expand All @@ -144,4 +139,3 @@ The `for` loop may also be fast, but it leaves a mutable member variable for the
[approach-intstream-map-sum]: https://exercism.org/tracks/java/exercises/hamming/approaches/intstream-map-sum
[approach-intstream-reduce]: https://exercism.org/tracks/java/exercises/hamming/approaches/intstream-reduce
[jmh]: https://github.com/openjdk/jmh
[final]: https://en.wikibooks.org/wiki/Java_Programming/Keywords/final