On Sun, 16 Oct 2022 19:43:54 GMT, Tagir F. Valeev <tval...@openjdk.org> wrote:
>> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Update src/java.base/share/classes/java/util/TreeMap.java >> >> Co-authored-by: ExE Boss <3889017+exe-b...@users.noreply.github.com> > > I saw this code many times and always thought that it exists for performance > purposes, to avoid extra indirection via likely megamorphic naturalOrder > comparator which will slow down the operations on common path. I think such a > simplification could be accepted only if accompanied by a properly written > benchmark (which actually emulates megamorphic callsite) which shows no > performance regression. @amaembo you mean we should have a benchmark measuring a `TreeMap.get()` with lots of implementations of Comparators or Comparables? ------------- PR: https://git.openjdk.org/jdk/pull/9901