Sorting in Java — Comparators, Natural Ordering, and Where Performance Actually Comes From
- Published
- Author
- Arif IkhsanudinBackend Developer
Java's sort is fast. The comparators passed to it often aren't. Here is how natural ordering, Comparator composition, and the contracts comparators must satisfy interact — and where subtle bugs hide.
Read more