Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v4]

2025-04-05 Thread Chen Liang
On Fri, 11 Oct 2024 15:49:33 GMT, Chen Liang wrote: >> Please review this patch that: >> 1. Implemented `forEach` to optimize for 1 or 2 element collections. >> 2. Implemented `spliterator` to optimize for a single element. >> >> The default implementations for multiple-element immutable collect

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v4]

2025-04-03 Thread Chen Liang
On Fri, 11 Oct 2024 15:49:33 GMT, Chen Liang wrote: >> Please review this patch that: >> 1. Implemented `forEach` to optimize for 1 or 2 element collections. >> 2. Implemented `spliterator` to optimize for a single element. >> >> The default implementations for multiple-element immutable collect

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v4]

2025-04-01 Thread Viktor Klang
On Fri, 11 Oct 2024 15:49:33 GMT, Chen Liang wrote: >> Please review this patch that: >> 1. Implemented `forEach` to optimize for 1 or 2 element collections. >> 2. Implemented `spliterator` to optimize for a single element. >> >> The default implementations for multiple-element immutable collect

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v4]

2025-04-01 Thread Stuart Marks
On Fri, 11 Oct 2024 15:49:33 GMT, Chen Liang wrote: >> Please review this patch that: >> 1. Implemented `forEach` to optimize for 1 or 2 element collections. >> 2. Implemented `spliterator` to optimize for a single element. >> >> The default implementations for multiple-element immutable collect

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v4]

2024-11-08 Thread Chen Liang
On Fri, 11 Oct 2024 15:49:33 GMT, Chen Liang wrote: >> Please review this patch that: >> 1. Implemented `forEach` to optimize for 1 or 2 element collections. >> 2. Implemented `spliterator` to optimize for a single element. >> >> The default implementations for multiple-element immutable collect

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v3]

2024-10-11 Thread Chen Liang
On Wed, 25 Sep 2024 20:46:27 GMT, Stuart Marks wrote: >> Chen Liang has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 16 commits: >> >> - Add test to ensure reproducible iteration order >> - Merge branch 'master' of https://github

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v4]

2024-10-11 Thread Chen Liang
> Please review this patch that: > 1. Implemented `forEach` to optimize for 1 or 2 element collections. > 2. Implemented `spliterator` to optimize for a single element. > > The default implementations for multiple-element immutable collections are > fine as-is, specializing implementation doesn't

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v2]

2024-09-25 Thread Stuart Marks
On Fri, 22 Mar 2024 09:25:06 GMT, Viktor Klang wrote: >> BenchmarkMode CntScore Error Units >> ImmutableColls.forEachOverList thrpt 15 361.423 ± 8.751 ops/us >> ImmutableColls.forEachOverSet thrpt 15 79.158 ± 5.064 ops/us >> ImmutableColls.getOrDefault

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v3]

2024-09-25 Thread Stuart Marks
On Fri, 26 Apr 2024 22:27:21 GMT, Chen Liang wrote: >> Please review this patch that: >> 1. Implemented `forEach` to optimize for 1 or 2 element collections. >> 2. Implemented `spliterator` to optimize for a single element. >> >> The default implementations for multiple-element immutable collect

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v3]

2024-09-15 Thread Chen Liang
On Fri, 26 Apr 2024 22:27:21 GMT, Chen Liang wrote: >> Please review this patch that: >> 1. Implemented `forEach` to optimize for 1 or 2 element collections. >> 2. Implemented `spliterator` to optimize for a single element. >> >> The default implementations for multiple-element immutable collect

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v3]

2024-08-18 Thread Chen Liang
On Fri, 26 Apr 2024 22:27:21 GMT, Chen Liang wrote: >> Please review this patch that: >> 1. Implemented `forEach` to optimize for 1 or 2 element collections. >> 2. Implemented `spliterator` to optimize for a single element. >> >> The default implementations for multiple-element immutable collect

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v3]

2024-05-25 Thread Chen Liang
On Fri, 26 Apr 2024 22:27:21 GMT, Chen Liang wrote: >> Please review this patch that: >> 1. Implemented `forEach` to optimize for 1 or 2 element collections. >> 2. Implemented `spliterator` to optimize for a single element. >> >> The default implementations for multiple-element immutable collect

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v2]

2024-04-27 Thread ExE Boss
On Fri, 26 Apr 2024 22:11:07 GMT, Chen Liang wrote: >> Do we need additional tests or are these modifications already covered by >> the existing tests? > > @minborg I have added a test as part of Collection mother-of-all-tests to > ensure spliterator and forEach yields in the same order as iter

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v2]

2024-04-26 Thread Chen Liang
On Tue, 23 Apr 2024 13:13:03 GMT, Per Minborg wrote: >> Chen Liang has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 13 commits: >> >> - Use the improved form in forEach >> - Merge branch 'master' of https://github.com/openjdk/jdk

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v3]

2024-04-26 Thread Chen Liang
> Please review this patch that: > 1. Implemented `forEach` to optimize for 1 or 2 element collections. > 2. Implemented `spliterator` to optimize for a single element. > > The default implementations for multiple-element immutable collections are > fine as-is, specializing implementation doesn't

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v2]

2024-04-23 Thread Chen Liang
On Tue, 23 Apr 2024 13:13:03 GMT, Per Minborg wrote: > Do we need additional tests or are these modifications already covered by the > existing tests? Thanks for the note, upon review it seems the default method overrides aren't covered by existing Collection tests. I should add them to ensure

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v2]

2024-04-23 Thread Per Minborg
On Thu, 21 Mar 2024 18:01:38 GMT, Chen Liang wrote: >> Please review this patch that: >> 1. Implemented `forEach` to optimize for 1 or 2 element collections. >> 2. Implemented `spliterator` to optimize for a single element. >> >> The default implementations for multiple-element immutable collect

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v2]

2024-04-23 Thread Viktor Klang
On Thu, 21 Mar 2024 18:01:38 GMT, Chen Liang wrote: >> Please review this patch that: >> 1. Implemented `forEach` to optimize for 1 or 2 element collections. >> 2. Implemented `spliterator` to optimize for a single element. >> >> The default implementations for multiple-element immutable collect

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v2]

2024-03-22 Thread Viktor Klang
On Fri, 22 Mar 2024 00:21:56 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/util/ImmutableCollections.java line 924: >> >>> 922: action.accept(REVERSE ? (E)e1 : e0); // implicit null >>> check >>> 923: action.accept(REVERSE ? e0 : (E)e1); >>> 924:

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v2]

2024-03-21 Thread Chen Liang
On Thu, 21 Mar 2024 20:09:23 GMT, Viktor Klang wrote: >> Chen Liang has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 13 commits: >> >> - Use the improved form in forEach >> - Merge branch 'master' of https://github.com/openjdk/jd

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v2]

2024-03-21 Thread Viktor Klang
On Thu, 21 Mar 2024 18:01:38 GMT, Chen Liang wrote: >> Please review this patch that: >> 1. Implemented `forEach` to optimize for 1 or 2 element collections. >> 2. Implemented `spliterator` to optimize for a single element. >> >> The default implementations for multiple-element immutable collect

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v2]

2024-03-21 Thread Chen Liang
On Tue, 12 Mar 2024 10:12:18 GMT, Viktor Klang wrote: >> Chen Liang has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 13 commits: >> >> - Use the improved form in forEach >> - Merge branch 'master' of https://github.com/openjdk/jd

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v2]

2024-03-21 Thread Chen Liang
> Please review this patch that: > 1. Implemented `forEach` to optimize for 1 or 2 element collections. > 2. Implemented `spliterator` to optimize for a single element. > > The default implementations for multiple-element immutable collections are > fine as-is, specializing implementation doesn't

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections

2024-03-12 Thread Chen Liang
On Tue, 12 Mar 2024 10:12:18 GMT, Viktor Klang wrote: >> Please review this patch that: >> 1. Implemented `forEach` to optimize for 1 or 2 element collections. >> 2. Implemented `spliterator` to optimize for a single element. >> >> The default implementations for multiple-element immutable colle

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections

2024-03-12 Thread Viktor Klang
On Wed, 20 Sep 2023 04:52:31 GMT, Chen Liang wrote: > Please review this patch that: > 1. Implemented `forEach` to optimize for 1 or 2 element collections. > 2. Implemented `spliterator` to optimize for a single element. > > The default implementations for multiple-element immutable collections

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections

2024-03-11 Thread Chen Liang
On Wed, 20 Sep 2023 04:52:31 GMT, Chen Liang wrote: > Please review this patch that: > 1. Implemented `forEach` to optimize for 1 or 2 element collections. > 2. Implemented `spliterator` to optimize for a single element. > > The default implementations for multiple-element immutable collections

RFR: 8327858: Improve spliterator and forEach for single-element immutable collections

2024-03-11 Thread Chen Liang
Please review this patch that: 1. Implemented `forEach` to optimize for 1 or 2 element collections. 2. Implemented `spliterator` to optimize for a single element. The default implementations for multiple-element immutable collections are fine as-is, specializing implementation doesn't provide muc