Re: RFR: 8358533: Improve performance of java.io.Reader.readAllLines [v7]

2025-07-02 Thread Roger Riggs
On Fri, 27 Jun 2025 23:00:04 GMT, Brian Burkhalter wrote: >> src/java.base/share/classes/java/io/Reader.java line 504: >> >>> 502: } >>> 503: if (fragLen >= cb.length/2) { >>> 504: // allocate larger buffer and copy chars to >>> be

Re: RFR: 8358533: Improve performance of java.io.Reader.readAllLines [v7]

2025-06-27 Thread Brian Burkhalter
On Fri, 27 Jun 2025 22:46:40 GMT, Xueming Shen wrote: > [...] more in line with how resizing is handled in string builder Looks like `StringBuilder` eventually calls `ArraysSupport.newLength(int,int.int)`. This is probably worth checking out. - PR Review Comment: https://git.openj

Re: RFR: 8358533: Improve performance of java.io.Reader.readAllLines [v7]

2025-06-27 Thread Xueming Shen
On Fri, 27 Jun 2025 17:32:25 GMT, Brian Burkhalter wrote: >> Replaces the implementation `readAllCharsAsString().lines().toList()` with >> reading into a temporary `char` array which is then processed to detect line >> terminators and copy non-terminating characters into strings which are added

Re: RFR: 8358533: Improve performance of java.io.Reader.readAllLines [v7]

2025-06-27 Thread Brian Burkhalter
On Fri, 27 Jun 2025 19:21:19 GMT, Roger Riggs wrote: > More directly, use limit instead of term in the computation of length. Good point. So changed in 3e5e498. - PR Review Comment: https://git.openjdk.org/jdk/pull/25863#discussion_r2172749427

Re: RFR: 8358533: Improve performance of java.io.Reader.readAllLines [v7]

2025-06-27 Thread Roger Riggs
On Fri, 27 Jun 2025 18:54:20 GMT, Brian Burkhalter wrote: >> Yes, `term == limit`. The "no line terminator" means none was encountered >> before the buffer's end was reached. > > Maybe it should be something like: > > // no line terminator before end of buffer More directly, use limit instead

Re: RFR: 8358533: Improve performance of java.io.Reader.readAllLines [v7]

2025-06-27 Thread Brian Burkhalter
On Fri, 27 Jun 2025 18:52:14 GMT, Brian Burkhalter wrote: >> src/java.base/share/classes/java/io/Reader.java line 494: >> >>> 492: skipLF = isCR; >>> 493: } else { // no line terminator >>> 494: int len = term - pos; >> >> I think term ==

Re: RFR: 8358533: Improve performance of java.io.Reader.readAllLines [v7]

2025-06-27 Thread Brian Burkhalter
On Fri, 27 Jun 2025 18:44:55 GMT, Roger Riggs wrote: >> Brian Burkhalter has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - 8358533: Use a boolean instead of fragPos != -1 >> - 8358533: Immediately skip LF right after CR > > src/java.bas

Re: RFR: 8358533: Improve performance of java.io.Reader.readAllLines [v7]

2025-06-27 Thread Roger Riggs
On Fri, 27 Jun 2025 17:32:25 GMT, Brian Burkhalter wrote: >> Replaces the implementation `readAllCharsAsString().lines().toList()` with >> reading into a temporary `char` array which is then processed to detect line >> terminators and copy non-terminating characters into strings which are added

Re: RFR: 8358533: Improve performance of java.io.Reader.readAllLines [v7]

2025-06-27 Thread Brian Burkhalter
> Replaces the implementation `readAllCharsAsString().lines().toList()` with > reading into a temporary `char` array which is then processed to detect line > terminators and copy non-terminating characters into strings which are added > to the list. Brian Burkhalter has updated the pull request