RFR: 8293630: Simplify TreeMap.get() with Comparator.naturalOrder() [v3]
Сергей Цыпанов
duke at openjdk.org
Mon Oct 17 09:40:03 UTC 2022
On Sun, 16 Oct 2022 19:43:54 GMT, Tagir F. Valeev <tvaleev at 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-Boss at 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
More information about the core-libs-dev
mailing list