Re: RFR: 8293630: Simplify TreeMap.get() with Comparator.naturalOrder() [v3]

2022-10-17 Thread Tagir F . Valeev
On Mon, 17 Oct 2022 09:38:01 GMT, Сергей Цыпанов wrote: >> 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 >>

Re: RFR: 8293630: Simplify TreeMap.get() with Comparator.naturalOrder() [v3]

2022-10-17 Thread Сергей Цыпанов
On Sun, 16 Oct 2022 19:43:54 GMT, Tagir F. Valeev 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...@us

Re: RFR: 8293630: Simplify TreeMap.get() with Comparator.naturalOrder() [v3]

2022-10-16 Thread Tagir F . Valeev
On Fri, 14 Oct 2022 19:03:11 GMT, Сергей Цыпанов wrote: >> We can use `Comparator.naturalOrder()` for cases when a `TreeMap` instance >> is constructed without comparator. This allows to squash two branches in >> `TreeMap.get()` into one. >> >> P.S. I think the comment of `TreeMap.getEntryUsin

Re: RFR: 8293630: Simplify TreeMap.get() with Comparator.naturalOrder() [v3]

2022-10-14 Thread Сергей Цыпанов
> We can use `Comparator.naturalOrder()` for cases when a `TreeMap` instance is > constructed without comparator. This allows to squash two branches in > `TreeMap.get()` into one. > > P.S. I think the comment of `TreeMap.getEntryUsingComparator()` is outdated. > Should we also change it? Серге