Re: Towards a JSON API for the JDK

2025-05-19 Thread forax
> From: "Paul Sandoz" > To: "Remi Forax" > Cc: "Brian Goetz" , "core-libs-dev" > > Sent: Monday, May 19, 2025 11:18:26 PM > Subject: Re: Towards a JSON API for the JDK > Those extending the non-sealed subtypes of JsonValue must

Re: Towards a JSON API for the JDK

2025-05-19 Thread forax
> From: "Paul Sandoz" > To: "Remi Forax" > Cc: "Brian Goetz" , "core-libs-dev" > > Sent: Monday, May 19, 2025 10:02:50 PM > Subject: Re: Towards a JSON API for the JDK >> On May 19, 2025, at 8:16 AM, Remi Forax wrote: &g

Re: Towards a JSON API for the JDK

2025-05-19 Thread Remi Forax
imal () { throw new UnsupportedOperationException(); } public String toString () { return "NaN" ; } }; var json = Json.fromUntyped( List . of ( funJsonNumber )); For me, the Json hierarchy should be implemented with true ADTs, with all subtypes of JsonValue being records. regard

Re: Towards a JSON API for the JDK

2025-05-19 Thread forax
- Original Message - > From: "cay horstmann" > To: "Remi Forax" > Cc: "core-libs-dev" > Sent: Monday, May 19, 2025 4:12:55 PM > Subject: Re: Towards a JSON API for the JDK > Il 19/05/25 10:13, Remi Forax ha scritto: >>> If only

Re: Towards a JSON API for the JDK

2025-05-19 Thread Remi Forax
We already have that, it's called a record :) Basically, you are advocating for a mapping JsonObject <--> record. [...] > > Cheers, > > Cay > Here is a simple JsonObject mapper using java.util.json types. https://github.com/forax/json-object-mapper I believe this is also t

Re: C2 inlining failed because the String constructor is too large

2025-05-18 Thread Remi Forax
It's perhaps easier to just add an annotation @ForceInlining. regards, Rémi > From: "wenshao" > To: "core-libs-dev" > Sent: Sunday, May 18, 2025 5:51:15 PM > Subject: C2 inlining failed because the String constructor is too large > Through JVM Option +PrintInlining, we found that String has

Re: Towards a JSON API for the JDK

2025-05-16 Thread forax
> From: "Brian Goetz" > To: "Remi Forax" > Cc: "Paul Sandoz" , "core-libs-dev" > > Sent: Friday, May 16, 2025 7:46:09 PM > Subject: Re: Towards a JSON API for the JDK > If you read the implementation, you'll see that significan

Re: Towards a JSON API for the JDK

2025-05-16 Thread forax
- Original Message - > From: "naoto sato" > To: "Remi Forax" , "Paul Sandoz" > Cc: "core-libs-dev" > Sent: Friday, May 16, 2025 6:35:50 PM > Subject: Re: Towards a JSON API for the JDK > Hi Rémi, > > On 5/15/25 2:27 PM

Re: Towards a JSON API for the JDK

2025-05-16 Thread forax
- Original Message - > From: "Brian Goetz" > To: "Remi Forax" , "Paul Sandoz" > Cc: "core-libs-dev" > Sent: Friday, May 16, 2025 2:53:18 PM > Subject: Re: Towards a JSON API for the JDK > On 5/15/2025 5:27 PM, Remi Forax wrote:

Re: Towards a JSON API for the JDK

2025-05-16 Thread forax
> From: "Ethan McCue" > To: "Remi Forax" > Cc: "Paul Sandoz" , "core-libs-dev" > > Sent: Friday, May 16, 2025 1:44:52 AM > Subject: Re: Towards a JSON API for the JDK > I present for your consideration the library I made when sp

Re: Towards a JSON API for the JDK

2025-05-15 Thread Remi Forax
Hi Paul, yes, not having a simple JSON API in Java is an issue for beginners. It's not clear to me why JsonArray (for example) has to be an interface instead of a record ? I understand why Json.parse() only works on String and char[] but the API make it too easy to have many performance issues.

Re: RFR: 8356993: ArrayDeque should use Arrays.fill() instead of for() loops [v2]

2025-05-15 Thread Rémi Forax
On Thu, 15 May 2025 17:46:39 GMT, Archie Cobbs wrote: >> Please review this small performance tweak `ArrayDeque`. >> >> `ArrayDeque` has an invariant in which any unused elements in the array must >> be null. In a couple of places, the code is setting contiguous ranges of >> elements to null u

Re: RFR: 8143850: Add indexed get() and set() methods to ArrayDeque

2025-05-13 Thread Rémi Forax
On Mon, 12 May 2025 18:24:27 GMT, Archie Cobbs wrote: > Because it is backed by an array, the `ArrayDeque` class has the ability to > get and replace any element in the list (accessed by index) in constant time. > However, this capability is not exposed in the API. > > Please review this PR wh

Re: Finding max or min of exactly two objects

2025-05-13 Thread Remi Forax
> From: "Brian Goetz" > To: "Tagir Valeev" , "core-libs-dev" > > Sent: Tuesday, May 13, 2025 4:30:33 PM > Subject: Re: Finding max or min of exactly two objects > When we did Lambda, we made a few mistakes in the category of adding default > methods to some "highly abstract" types, such as Funct

Re: Unnecessary logic is added to removeFirst and removeLast of ArrayList.

2025-05-11 Thread forax
> From: "Chen Liang" > To: "Remi Forax" > Cc: "core-libs-dev" > Sent: Sunday, May 11, 2025 5:41:25 PM > Subject: Re: Unnecessary logic is added to removeFirst and removeLast of > ArrayList. > > where the generated assembly code by the JITs

Re: Unnecessary logic is added to removeFirst and removeLast of ArrayList.

2025-05-11 Thread Remi Forax
> From: "임민수" > To: "core-libs-dev" > Sent: Friday, May 9, 2025 10:33:30 AM > Subject: Unnecessary logic is added to removeFirst and removeLast of > ArrayList. > Hi. > In removeFirst, if size is not 0, the logic is the same as the remove logic. > removeLast also has the same logic as remove w

Re: ArrayList print capacity

2025-05-11 Thread Remi Forax
Hello, this is not an overlook, the less you expose (make public), the easier it is to change the implementation in the future. Also, the collection API was design to avoid (if possible) to have more public methods in the implementation (ArrayList) than you have in the interface (List). So

Re: RFR: 8354724: BufferedReader readAllLines and readString methods [v14]

2025-05-02 Thread Rémi Forax
On Wed, 23 Apr 2025 22:04:25 GMT, Brian Burkhalter wrote: >> Implement the requested methods and add a test thereof. > > Brian Burkhalter has updated the pull request incrementally with one > additional commit since the last revision: > > 8354724: Fix readAllChars gaffe in Reader returned by

Re: RFR: 8354300: Fields in String are not trusted

2025-04-15 Thread Rémi Forax
On Wed, 16 Apr 2025 00:01:18 GMT, Chen Liang wrote: >> This PR proposes to add the `@Stable` annotation to `j.l.String.hash` and >> `j.l.String.hashIsZero`. This means the VM can trust these fields to never >> change which enables constant folding optimizations. >> >> This PR is tested in tier

Re: My experience using Java to do CLI Scripting

2025-04-15 Thread forax
- Original Message - > From: "Stuart Marks" > To: "Remi Forax" , "Ron Pressler" > , "David Alayachew" > > Cc: "cay horstmann" , "core-libs-dev" > > Sent: Tuesday, April 15, 2025 12:10:54 AM > Subject

Re: [External] : Re: My experience using Java to do CLI Scripting

2025-04-15 Thread forax
- Original Message - > From: "Ron Pressler" > To: "Remi Forax" > Cc: "cay horstmann" , "core-libs-dev" > , "David Alayachew" > > Sent: Monday, April 14, 2025 11:46:25 PM > Subject: Re: [External] : Re: My exper

Re: My experience using Java to do CLI Scripting

2025-04-14 Thread Remi Forax
- Original Message - > From: "Ron Pressler" > To: "cay horstmann" > Cc: "core-libs-dev" , "David Alayachew" > > Sent: Monday, April 14, 2025 10:30:40 PM > Subject: Re: My experience using Java to do CLI Scripting > (moved from amber-dev) > > Hi. > > This does what you want (and could

Re: java.lang.String hashCode and @Stable ?

2025-04-11 Thread forax
> From: "Chen Liang" > To: "Remi Forax" , "core-libs-dev" > > Sent: Thursday, April 10, 2025 8:16:39 PM > Subject: Re: java.lang.String hashCode and @Stable ? > Hi Remi, > I think this is probably due to these fields being added too early -

Re: java.lang.String hashCode and @Stable ?

2025-04-11 Thread forax
> From: "Glavo" > To: "Chen Liang" > Cc: "Remi Forax" , "core-libs-dev" > > Sent: Thursday, April 10, 2025 8:54:57 PM > Subject: Re: java.lang.String hashCode and @Stable ? > Hi Chen, > I think we can choose an arbitrary non-zer

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v53]

2025-04-10 Thread Rémi Forax
On Thu, 10 Apr 2025 13:46:17 GMT, Per Minborg wrote: > > > ``` > > > > > > I will take a look at it. > > > ``` > > > > > > As i said in another mail to core-lib this morning, it seems that the field > > storing the hashcode of String is not marked with @stable. That's may be > > the issue. >

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v51]

2025-04-10 Thread Rémi Forax
On Thu, 10 Apr 2025 12:51:43 GMT, Per Minborg wrote: > > ``` > > I will take a look at it. As i said in another mail to core-lib this morning, it seems that the field storing the hashcode of String is not marked with @Stable. That's may be the issue. - PR Comment: h

java.lang.String hashCode and @Stable ?

2025-04-10 Thread Remi Forax
Question, why String.hash and String.hashIsZero are not declared @Stable ? regards, Rémi

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v51]

2025-04-09 Thread Rémi Forax
On Mon, 7 Apr 2025 16:00:41 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request incrementally with one additional > commit since the last revision: > > Fix typo in return type Hello, I do not know if you know but

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v51]

2025-04-09 Thread Rémi Forax
On Mon, 7 Apr 2025 16:00:41 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request incrementally with one additional > commit since the last revision: > > Fix typo in return type src/java.base/share/classes/java/lang

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-04-02 Thread Remi Forax
Hi Per, last week, at JChateau, we had a one hour session about stable values, I've build the JDK with this PR so we can discuss about it. To present the API, i start from the double check locking, rewriting it to use the StableValue API. The main remark was that methods like orElseSet() or isS

Re: Missing offset+length Arrays.hashCode() methods?

2025-03-17 Thread Remi Forax
Just a comment "en passant", array, List or String in Java tend to use the from/to index convention instead of the offset+length convention which is the convention for system calls (read/write etc). regards, Rémi > From: "Roger Riggs" > To: "core-libs-dev" > Sent: Monday, March 17, 2025 7

Re: [External] : Re: JDK-8072840: Presizing for Stream Collectors

2025-02-19 Thread forax
> From: "Viktor Klang" > To: "Remi Forax" , "Fabian Meumertzheim" > > Cc: "Paul Sandoz" , "core-libs-dev" > > Sent: Wednesday, February 19, 2025 11:43:33 AM > Subject: Re: [External] : Re: JDK-8072840: Presizing for Stream

Re: JDK-8072840: Presizing for Stream Collectors

2025-02-15 Thread Remi Forax
> From: "Viktor Klang" > To: "Paul Sandoz" , "Fabian Meumertzheim" > > Cc: "core-libs-dev" > Sent: Thursday, February 13, 2025 11:30:59 PM > Subject: Re: JDK-8072840: Presizing for Stream Collectors > Indeed. I hope I didn't sound discouraging about the possibility to propagate > the stream siz

Re: All classes in jdk.internal.random are not serializable

2025-01-30 Thread Remi Forax
> From: "Glavo" > To: "core-libs-dev" > Sent: Thursday, January 30, 2025 4:22:00 PM > Subject: All classes in jdk.internal.random are not serializable > Hi, > My friend was migrating from Random to RandomGenerator, but he ran into a > roadblock: > Random is serializable, but those new implementa

Re: Factory methods for SequencedSet and SequencedMap

2025-01-25 Thread forax
> From: "Rafael Winterhalter" > To: "Remi Forax" > Cc: "core-libs-dev" , "joe darcy" > > Sent: Tuesday, January 21, 2025 10:17:35 AM > Subject: Re: Factory methods for SequencedSet and SequencedMap > Wouldn't this already be po

Re: Adding BigDecimal.valueOf(float val) constructor

2025-01-23 Thread Remi Forax
Hello Jan, what you are suggesting is not a backward compatible change. If we add BigDecimal,valueOf(float), then a program recompiled with the new JDK may change its behavior, you can think that the new behavior is more "correct" that the current one, but changing the behavior of existing pr

Re: Factory methods for SequencedSet and SequencedMap

2025-01-19 Thread Remi Forax
What can be done is to have Set.of()/Map.of() to delegate to SequenceSet.of()/SequenceMap.of() so there is only one implementation at runtime. Also, technically, there is a way to change the return type in a binary compatible way ... if union types are supported in the language. In that case,

Re: Factory methods for SequencedSet and SequencedMap

2025-01-15 Thread Remi Forax
> From: "Rafael Winterhalter" > To: "core-libs-dev" > Sent: Thursday, January 16, 2025 8:13:17 AM > Subject: Factory methods for SequencedSet and SequencedMap > Hello, Hello, > I am happily taking SequencedSet and SequencedMap into use, but one > inconvenience I encounter is the lack of facto

Re: [External] : Gatherers.fold()

2025-01-02 Thread forax
> From: "Viktor Klang" > To: "Remi Forax" , "core-libs-dev" > > Sent: Thursday, January 2, 2025 12:26:08 PM > Subject: Re: [External] : Gatherers.fold() > Hi Rémi, Happy new year, >>Thinking a little more, i do not understand why fol

Gatherers.fold()

2024-12-20 Thread Remi Forax
as first parameter and not just a value given that the Gatherer is created with ofSequential(). regards, Rémi [1] https://adventofcode.com/2024/day/19 [2] https://github.com/forax/advent-of-code-2024

Re: High cost of failed Math.*Exact calls

2024-12-13 Thread Remi Forax
that this optimization occurs, it means that you have to generate the catch in the same method blob. One solution i've explored (10 years ago) but not pursue is to generate a code that the VM can de-optimize by itself without you having to generate a new code [ https://github.com/forax/v

Re: RFR: 8339916: AIOOBE due to Math.abs(Integer.MIN_VALUE) in tests

2024-11-22 Thread Rémi Forax
On Thu, 21 Nov 2024 17:21:07 GMT, Andrew Haley wrote: > Test bug. > > Another bug caused by the result of `Math.abs()` being negative. I also tried > `floorMod()`, which would have been cleaner, but it increased the runtime of > this extremely time-sensitive benchmark. Let say that the defini

Re: Can LinkedHashMap(accessOrder=true) be guarded by ReadWriteLock ?

2024-11-07 Thread Remi Forax
- Original Message - > From: "Andrey Turbanov" > To: "core-libs-dev" > Sent: Thursday, November 7, 2024 9:17:00 AM > Subject: Can LinkedHashMap(accessOrder=true) be guarded by ReadWriteLock ? > Hello. > I've got a question about LinkedHashMap created with accessOrder=true flag. > Usually

ewrite the last section of the overwiew fo SortedMap documentation and a link fo NavigableMap

2024-11-02 Thread Remi Forax
Hello, I was discussing with a student, she was trying to use the SortedMap interface but had trouble with tailMap() no being a strictly higher view from a key. The solution was to use NavigableMap instead of SortedMap because it provides more methods to get lower/higher subMap and entries from k

Re: RFR: 8342863: Use pattern matching for instanceof in equals methods of wrapper classes

2024-10-23 Thread Rémi Forax
ooleanValue(); >> >> I would go even a step further and use `value` instead of `booleanValue()`, >> `intValue()` etc because there is no need to call a method to get the value. >> >> >> if (obj instanceof Boolean b) { >> return value == b

Re: RFR: 8342863: Use pattern matching for instanceof in equals methods of wrapper classes

2024-10-22 Thread Rémi Forax
On Wed, 23 Oct 2024 02:06:20 GMT, Joe Darcy wrote: > Noticed this refactoring opportunity while doing some other work in the area. src/java.base/share/classes/java/lang/Boolean.java line 259: > 257: public boolean equals(Object obj) { > 258: if (obj instanceof Boolean b) { > 259:

Re: RFR: 8335480: Only deoptimize threads if needed when closing shared arena [v3]

2024-07-15 Thread Rémi Forax
On Mon, 15 Jul 2024 11:33:30 GMT, Jorn Vernee wrote: >> This PR limits the number of cases in which we deoptimize frames when >> closing a shared Arena. The initial intent of this was to improve the >> performance of shared arena closure in cases where a lot of threads are >> accessing and clo

Re: RFR: 8335480: Only deoptimize threads if needed when closing shared arena [v2]

2024-07-15 Thread Rémi Forax
On Mon, 15 Jul 2024 10:50:34 GMT, Jorn Vernee wrote: > This is what I was thinking of as well. close() on a shared arena can be > called by any thread, so it would be possible to have an executor service > with 1-n threads that is dedicated to closing memory. This delays both the closing of th

Re: RFR: 8335480: Only deoptimize threads if needed when closing shared arena [v2]

2024-07-13 Thread Rémi Forax
On Fri, 12 Jul 2024 20:59:26 GMT, Jorn Vernee wrote: >> This PR limits the number of cases in which we deoptimize frames when >> closing a shared Arena. The initial intent of this was to improve the >> performance of shared arena closure in cases where a lot of threads are >> accessing and clo

Re: RFR: 8335480: Only deoptimize threads if needed when closing shared arena [v2]

2024-07-13 Thread Rémi Forax
On Fri, 12 Jul 2024 20:59:26 GMT, Jorn Vernee wrote: >> This PR limits the number of cases in which we deoptimize frames when >> closing a shared Arena. The initial intent of this was to improve the >> performance of shared arena closure in cases where a lot of threads are >> accessing and clo

Re: [External] : Gatherer and primitive specialization

2024-06-13 Thread forax
> From: "Viktor Klang" > To: "Remi Forax" , "core-libs-dev" > > Sent: Thursday, June 13, 2024 12:52:03 PM > Subject: Re: [External] : Gatherer and primitive specialization > Hi Rémi, > Given that Collector has not been specialized since

Gatherer and primitive specialization

2024-06-13 Thread Remi Forax
Hello, the Gatherer API do not provide primitive specialization while intermediate methods like map(), flatMap() or mapMulti() do. Unlike collectors where it is okay to not be specialized because most collectors mutate a collection that is not specialized too, gatherers can process/transform val

Re: RFR: 8333265: De-duplicate method references in java.util.stream.FindOps

2024-05-30 Thread Rémi Forax
On Thu, 30 May 2024 12:50:36 GMT, Claes Redestad wrote: > Extracting duplicate method references to static field reduce proxy class > spinning and loading. In this case 2 less classes loaded when using > `findAny()` on each type of stream. For constant method reference, the solution is to use

Re: RFR: 8242888: Convert dynamic proxy to hidden classes

2024-05-23 Thread forax
> From: "-" > To: "Remi Forax" > Cc: "Chen Liang" , "core-libs-dev" > , "hotspot-dev" , > "kulla-dev" > Sent: Thursday, May 23, 2024 2:56:58 PM > Subject: Re: RFR: 8242888: Convert dynamic proxy to hidden classes

Re: RFR: 8242888: Convert dynamic proxy to hidden classes

2024-05-23 Thread Remi Forax
- Original Message - > From: "Chen Liang" > To: "core-libs-dev" , "hotspot-dev" > , kulla-...@openjdk.org > Sent: Thursday, May 23, 2024 1:28:01 PM > Subject: Re: RFR: 8242888: Convert dynamic proxy to hidden classes > On Thu, 23 May 2024 03:28:30 GMT, Chen Liang wrote: > >> Please rev

Re: RFR: 8330465: Stable Values and Collections (Internal) [v4]

2024-05-15 Thread Rémi Forax
On Wed, 15 May 2024 11:27:04 GMT, ExE Boss wrote: >>> Maybe export this interface to `jdk.unsupported`? >> >> I don't we should do that. In general, we need jdk.unsupported to go away in >> the long term. Also integrity of the platform depends on java.base being >> very stingy and not exportin

Re: RFR: 8305457: Implement java.io.IO [v3]

2024-05-07 Thread Rémi Forax
On Tue, 7 May 2024 16:09:08 GMT, Pavel Rappo wrote: >> I do not think the step to "standardise" a preview feature exists ? When a >> preview feature becomes a released feature, the code is very lightly edited, >> at least it this is my experience. >> >> You can change both readln and readLine

Re: RFR: 8305457: Implement java.io.IO

2024-05-07 Thread Rémi Forax
On Tue, 7 May 2024 11:00:52 GMT, Pavel Rappo wrote: >> src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java line 74: >> >>> 72: >>> 73: @Override >>> 74: public String readln(String prompt) { >> >> this code can be simplified using an early return (and the body of the >> tr

Re: RFR: 8305457: Implement java.io.IO

2024-05-06 Thread Rémi Forax
On Mon, 6 May 2024 21:45:12 GMT, Pavel Rappo wrote: > Please review this PR which introduces the `java.io.IO` top-level class and > three methods to `java.io.Console` for [Implicitly Declared Classes and > Instance Main Methods (Third Preview)]. > > This PR has been obtained as `git merge --sq

Re: Addition of Predicate-based findIndex and findLastIndex methods to java.util.List

2024-04-19 Thread forax
> From: "David Alayachew" > To: "Remi Forax" > Cc: "ІП-24 Олександр Ротань" , "core-libs-dev" > > Sent: Friday, April 19, 2024 11:02:12 PM > Subject: Re: Addition of Predicate-based findIndex and findLastIndex methods > to >

Re: Addition of Predicate-based findIndex and findLastIndex methods to java.util.List

2024-04-19 Thread Remi Forax
Hello, for me, it seems what you want is Collector on Stream which is able to short-circuit, so you can write list.stream().collect(Collectors.findFirst(s -> s.contains("o"))) and in reverse list.reversed().stream().collect(Collectors.findFirst(s -> s.contains("o"))) Using a Stream here is

Re: RFR: 8196106: Support nested infinite or recursive flat mapped streams [v7]

2024-04-13 Thread Rémi Forax
On Fri, 12 Apr 2024 14:53:01 GMT, Viktor Klang wrote: >> This PR implements Gatherer-inspired encoding of `flatMap` that shows that >> it is both competitive performance-wise as well as improve correctness. >> >> Below is the performance of `Stream::flatMap` (for reference types): >> >> Before

Re: RFR: 8196106: Support nested infinite or recursive flat mapped streams [v7]

2024-04-13 Thread Rémi Forax
On Fri, 12 Apr 2024 14:53:01 GMT, Viktor Klang wrote: >> This PR implements Gatherer-inspired encoding of `flatMap` that shows that >> it is both competitive performance-wise as well as improve correctness. >> >> Below is the performance of `Stream::flatMap` (for reference types): >> >> Before

Re: RFR: 8196106: Support nested infinite or recursive flat mapped streams [v7]

2024-04-13 Thread Rémi Forax
On Fri, 12 Apr 2024 14:53:01 GMT, Viktor Klang wrote: >> This PR implements Gatherer-inspired encoding of `flatMap` that shows that >> it is both competitive performance-wise as well as improve correctness. >> >> Below is the performance of `Stream::flatMap` (for reference types): >> >> Before

Re: RFR: 8327247: C2 uses up to 2GB of RAM to compile complex string concat in extreme cases

2024-04-12 Thread Rémi Forax
On Tue, 9 Apr 2024 12:01:49 GMT, Claes Redestad wrote: > This patch suggests a workaround to an issue with huge SCF MH expression > trees taking excessive JIT compilation resources by reviving (part of) the > simple bytecode-generating strategy that was originally available as an > all-or-noth

Re: Gatherer: spliterator characteristics are not propagated

2024-01-25 Thread forax
> From: "Viktor Klang" > To: "Remi Forax" > Cc: "core-libs-dev" , "Paul Sandoz" > > Sent: Wednesday, January 24, 2024 2:45:15 PM > Subject: Re: Gatherer: spliterator characteristics are not propagated > As a (related) side-n

Re: Gatherer: spliterator characteristics are not propagated

2024-01-25 Thread forax
> From: "Viktor Klang" > To: "Remi Forax" > Cc: "core-libs-dev" , "Paul Sandoz" > > Sent: Wednesday, January 24, 2024 2:34:11 PM > Subject: Re: Gatherer: spliterator characteristics are not propagated > Presuming that you mean mut

Re: Gatherer: spliterator characteristics are not propagated

2024-01-23 Thread forax
> From: "Viktor Klang" > To: "Remi Forax" > Cc: "core-libs-dev" , "Paul Sandoz" > > Sent: Monday, January 22, 2024 10:06:27 PM > Subject: Re: Gatherer: spliterator characteristics are not propagated >> The flags are in s

Re: Gatherer: spliterator characteristics are not propagated

2024-01-22 Thread forax
> From: "Viktor Klang" > To: "Remi Forax" > Cc: "core-libs-dev" , "Paul Sandoz" > > Sent: Monday, January 22, 2024 4:22:11 PM > Subject: Re: Gatherer: spliterator characteristics are not propagated > Hi Rémi, Hello, > For

Re: Gatherer: spliterator characteristics are not propagated

2024-01-20 Thread forax
> From: "Viktor Klang" > To: "Remi Forax" > Cc: "core-libs-dev" , "Paul Sandoz" > > Sent: Thursday, January 18, 2024 5:14:38 PM > Subject: Re: Gatherer: spliterator characteristics are not propagated >> And for A.andThen(B)

Re: Gatherer API : wildcards complaint

2024-01-18 Thread forax
> From: "Viktor Klang" > To: "Remi Forax" > Cc: "core-libs-dev" > Sent: Wednesday, January 17, 2024 9:00:32 PM > Subject: Re: Gatherer API : wildcards complaint > Ah, now I see what you mean! Thank you \uD83D\uDC4D > The reason for the

Re: Gatherer: spliterator characteristics are not propagated

2024-01-18 Thread forax
> From: "Viktor Klang" > To: "Remi Forax" > Cc: "core-libs-dev" , "Paul Sandoz" > > Sent: Thursday, January 18, 2024 3:36:07 PM > Subject: Re: Gatherer: spliterator characteristics are not propagated > I suspect that it is a rather

Re: Gatherer: spliterator characteristics are not propagated

2024-01-18 Thread forax
> From: "Viktor Klang" > To: "Remi Forax" , "core-libs-dev" > > Sent: Wednesday, January 17, 2024 8:48:07 PM > Subject: Re: Gatherer: spliterator characteristics are not propagated > Hi Rémi, > You can find some of my benches here: [ > htt

Re: Seing a Collector as a Gatherer

2024-01-17 Thread forax
> From: "Viktor Klang" > To: "Remi Forax" > Sent: Wednesday, January 17, 2024 6:01:38 PM > Subject: Re: Seing a Collector as a Gatherer > Hi Rémi, > Yes, this was something I was hoping to get into the preview, but I wasn't > sure > where

Re: Gatherer API : wildcards complaint

2024-01-17 Thread forax
> From: "Viktor Klang" > To: "Remi Forax" , "core-libs-dev" > > Sent: Wednesday, January 17, 2024 5:49:01 PM > Subject: Re: Gatherer API : wildcards complaint > Hi Rémi, > Thank you for the feedback—examples would be much appreciated

Seing a Collector as a Gatherer

2024-01-17 Thread Remi Forax
Hello, I may have overlook that, but it seems there is no method to see a Collector as a Gatherer. A Gatherer is more general than a Collector and a Gatherer with a greedy integrator that does not call Downstream.push in the intergator and only once is the finisher is basicaly a Collector. In

Gatherer API : wildcards complaint

2024-01-17 Thread Remi Forax
Hello, this is a minor complaint but I do not see a raison to not getting this right. Currently the Gatherer API does not use the wildcard correctly, which is not fully an issue because there is "enough" wildcards that if you rely on the inference, it will work. The problem is that when you wri

Gatherer: spliterator characteristics are not propagated

2024-01-17 Thread Remi Forax
this intermediate operation keep the size, which is important if the terminal operation is toList() because if the size is known, toList() will presize the List and avoid the creation of an intermediary ArrayList. See https://github.com/forax/we_are_all_to_gather/blob/master/src/main/java/com/gihtub/

Improving the Gatherer public API

2024-01-17 Thread Remi Forax
Hello, i've played quite a lot with the Gatherer API and overall, i quite like how things work conceptually. But i think the public API can be improved. First, the documentation is not fully clear that a Gatherer has 3 characteristics, 1/ Is it sequential or parallelizable (can be parallel is a

Re: Gatherers -- conditionalWindowFixed?

2024-01-10 Thread Remi Forax
> From: "Viktor Klang" > To: "David Alayachew" , "core-libs-dev" > > Sent: Wednesday, January 10, 2024 2:33:45 PM > Subject: Re: Gatherers -- conditionalWindowFixed? > Hi David! > Apologies for the late reply, there's been lots of catching up to do after the > holidays. > >I'm really excited f

Re: Gatherers -- conditionalWindowFixed?

2024-01-10 Thread Remi Forax
> From: "Remi Forax" > To: "David Alayachew" > Cc: "core-libs-dev" > Sent: Wednesday, January 10, 2024 8:19:15 AM > Subject: Re: Gatherers -- conditionalWindowFixed? > Hello David, > testing the gatherer api, I also wanted a "window&

Re: Gatherers -- conditionalWindowFixed?

2024-01-09 Thread Remi Forax
Hello David, testing the gatherer api, I also wanted a "window" operation as the one you are describing. My use cases is a text file with some sections containing items organized like this :section1 item1 item2 item3 :section2 item1 item2 ... For me the signature of such method, win

Re: Blessed modifier order does not include sealed/non-sealed

2024-01-02 Thread Remi Forax
- Original Message - > From: "Pavel Rappo" > To: "Roger Riggs" > Cc: "core-libs-dev" > Sent: Tuesday, January 2, 2024 5:31:06 PM > Subject: Re: Blessed modifier order does not include sealed/non-sealed > Hi Roger, > > Happy New Year to you too! > > Although it's a _somewhat_ separate

Re: Blessed modifier order does not include sealed/non-sealed

2024-01-02 Thread Remi Forax
- Original Message - > From: "Pavel Rappo" > To: "core-libs-dev" > Sent: Tuesday, January 2, 2024 12:56:08 PM > Subject: Blessed modifier order does not include sealed/non-sealed > I couldn't find any prior discussions on this matter. > > I noticed that bin/blessed-modifier-order.sh has

Re: RFR: 8322292: Rearrange comparison of fields in Record.equals()

2023-12-19 Thread Rémi Forax
On Tue, 19 Dec 2023 11:01:12 GMT, Hannes Greule wrote: > Isn't Arrays.equals() used under the hood? No, for arrays == is used - PR Comment: https://git.openjdk.org/jdk/pull/17143#issuecomment-1863374656

Re: RFR: 8319123: Implementation of JEP-461: Stream Gatherers (Preview) [v7]

2023-11-14 Thread Remi Forax
- Original Message - > From: "Viktor Klang" > To: "core-libs-dev" > Sent: Tuesday, November 14, 2023 11:32:48 AM > Subject: Re: RFR: 8319123: Implementation of JEP-461: Stream Gatherers > (Preview) [v7] > On Tue, 14 Nov 2023 09:48:13 GMT, Rémi F

Re: RFR: 8319123: Implementation of JEP-461: Stream Gatherers (Preview) [v7]

2023-11-14 Thread Rémi Forax
On Tue, 14 Nov 2023 07:51:42 GMT, Viktor Klang wrote: >> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) > > Viktor Klang has updated the pull request incrementally with one additional > commit since the last revision: > > Addressing last review feedback Hello, the relat

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Rémi Forax
On Mon, 30 Oct 2023 15:38:35 GMT, Viktor Klang wrote: > This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) src/java.base/share/classes/java/util/stream/Gatherers.java line 64: > 62: *needlessly > 63: * 3. allows for more efficient composition and evaluation > 64:

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Rémi Forax
On Mon, 30 Oct 2023 15:38:35 GMT, Viktor Klang wrote: > This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) src/java.base/share/classes/java/util/stream/GathererOp.java line 232: > 230: */ > 231: @SuppressWarnings("unchecked") > 232: private GathererOp(Gatherer gat

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Rémi Forax
On Mon, 30 Oct 2023 15:38:35 GMT, Viktor Klang wrote: > This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) src/java.base/share/classes/java/util/stream/GathererOp.java line 448: > 446: private final long targetSize; > 447: private final Hybrid leftPrede

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Rémi Forax
On Mon, 30 Oct 2023 15:38:35 GMT, Viktor Klang wrote: > This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) src/java.base/share/classes/java/util/stream/GathererOp.java line 180: > 178: finisher.accept(state, this); > 179: sink.end(); > 180:

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Rémi Forax
On Mon, 30 Oct 2023 15:38:35 GMT, Viktor Klang wrote: > This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) src/java.base/share/classes/java/util/stream/GathererOp.java line 95: > 93: public void accept(X x) { > 94: final var b = rightMost; > 95:

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Rémi Forax
On Mon, 30 Oct 2023 15:38:35 GMT, Viktor Klang wrote: > This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) src/java.base/share/classes/java/util/stream/GathererOp.java line 50: > 48: */ > 49: final class GathererOp extends ReferencePipeline { > 50: @SuppressWarnings("unch

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Rémi Forax
On Wed, 8 Nov 2023 17:22:05 GMT, Rémi Forax wrote: >> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) > > src/java.base/share/classes/java/util/stream/Gatherer.java line 490: > >> 488: * more elements sent to it, {@code false

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Rémi Forax
On Mon, 30 Oct 2023 15:38:35 GMT, Viktor Klang wrote: > This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) src/java.base/share/classes/java/util/stream/Gatherer.java line 444: > 442: */ > 443: static Gatherer of( > 444: Supplier initializer, wildcards ar

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Rémi Forax
On Wed, 8 Nov 2023 15:17:57 GMT, Viktor Klang wrote: >> It's still possible to have a situation where PECS signature could be >> useful, and I don't see any downsides. A user may want to reuse the same >> static integrator instead of creating several identical lambdas just because >> the targe

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Rémi Forax
On Sun, 5 Nov 2023 16:18:52 GMT, Tagir F. Valeev wrote: >> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) > > src/java.base/share/classes/java/util/stream/Gatherer.java line 330: > >> 328: static Gatherer ofSequential( >> 329: Integrator integrator, >> 330:

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Rémi Forax
On Wed, 8 Nov 2023 17:10:05 GMT, Tagir F. Valeev wrote: >> Has this proven to be a problem for things like >> [Collectors.mapping(…)](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/stream/Collectors.html#mapping(java.util.function.Function,java.util.stream.Collector)) >>

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Rémi Forax
On Tue, 31 Oct 2023 13:19:30 GMT, Viktor Klang wrote: >> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) > > src/java.base/share/classes/java/util/stream/AbstractPipeline.java line 242: > >> 240: } >> 241: >> 242: // Terminal evaluation methods > > This is needed i

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Rémi Forax
On Fri, 3 Nov 2023 16:51:34 GMT, Viktor Klang wrote: >> Since stream facilities are package-private, we can just use no access >> modifier and remove all new `protected` access modifier (on methods, fields, >> constructors) in this PR. > > @liach We could do that, yet I'm not sure that is stric

  1   2   3   >