Re: RFR: 8315999: Improve Date toString performance [v13]

2023-09-13 Thread 温绍锦
On Wed, 13 Sep 2023 21:22:43 GMT, 温绍锦 wrote: > Based on the use cases cited, if your library needs specific performance > improvements for specific formats, they should be done in that library. Not only JSON libraries, toString optimization of Date/Instant/LocalDateTime and other classes will

Re: RFR: 8315999: Improve Date toString performance [v13]

2023-09-13 Thread 温绍锦
On Wed, 13 Sep 2023 14:22:35 GMT, 温绍锦 wrote: >> improve date toString performance, includes: >> >> java.util.Date.toString >> java.util.Date.toGMTString >> java.time.Instant.toString >> java.time.LocalDate.toString >> java.time.LocalDateTime.toString >> java.time.LocalTime.toString > > 温绍锦 has u

Re: RFR: 8315999: Improve Date toString performance [v13]

2023-09-13 Thread 温绍锦
On Wed, 13 Sep 2023 19:21:34 GMT, Roger Riggs wrote: > Based on the use cases cited, if your library needs specific performance > improvements for specific formats, they should be done in that library. I already do this in [fastjson2](https://github.com/alibaba/fastjson2) for now, but more lib

Re: RFR: 8315999: Improve Date toString performance [v13]

2023-09-13 Thread Roger Riggs
On Wed, 13 Sep 2023 14:22:35 GMT, 温绍锦 wrote: >> improve date toString performance, includes: >> >> java.util.Date.toString >> java.util.Date.toGMTString >> java.time.Instant.toString >> java.time.LocalDate.toString >> java.time.LocalDateTime.toString >> java.time.LocalTime.toString > > 温绍锦 has u

Re: RFR: 8315999: Improve Date toString performance [v13]

2023-09-13 Thread Roger Riggs
On Wed, 13 Sep 2023 14:22:35 GMT, 温绍锦 wrote: >> improve date toString performance, includes: >> >> java.util.Date.toString >> java.util.Date.toGMTString >> java.time.Instant.toString >> java.time.LocalDate.toString >> java.time.LocalDateTime.toString >> java.time.LocalTime.toString > > 温绍锦 has u

Re: RFR: 8315999: Improve Date toString performance [v13]

2023-09-13 Thread 温绍锦
On Tue, 12 Sep 2023 22:53:34 GMT, Claes Redestad wrote: >> The reason for not using off++ is that it can be executed out of order, >> which may result in better performance. > > I don't think that would outweigh the extra branch and the increased code > size. I'd opt for simplicity. I've simpl

Re: RFR: 8315999: Improve Date toString performance [v13]

2023-09-13 Thread 温绍锦
> improve date toString performance, includes: > > java.util.Date.toString > java.util.Date.toGMTString > java.time.Instant.toString > java.time.LocalDate.toString > java.time.LocalDateTime.toString > java.time.LocalTime.toString 温绍锦 has updated the pull request incrementally with one additional

Re: RFR: 8315999: Improve Date toString performance [v12]

2023-09-12 Thread 温绍锦
On Tue, 12 Sep 2023 23:10:43 GMT, Claes Redestad wrote: >>> Have you considered potentially more generalizable optimizations to >>> `DateTimeFormatter.ISO_INSTANT.format(this)` here? >>> >>> Hand-rolling a fixed-length buffer, skipping the `StringBuilder` .. >>> understandably this can have a

Re: RFR: 8315999: Improve Date toString performance [v12]

2023-09-12 Thread 温绍锦
> improve date toString performance, includes: > > java.util.Date.toString > java.util.Date.toGMTString > java.time.Instant.toString > java.time.LocalDate.toString > java.time.LocalDateTime.toString > java.time.LocalTime.toString 温绍锦 has updated the pull request incrementally with two additional

Re: RFR: 8315999: Improve Date toString performance [v11]

2023-09-12 Thread 温绍锦
> improve date toString performance, includes: > > java.util.Date.toString > java.util.Date.toGMTString > java.time.Instant.toString > java.time.LocalDate.toString > java.time.LocalDateTime.toString > java.time.LocalTime.toString 温绍锦 has updated the pull request incrementally with one additional

Re: RFR: 8315999: Improve Date toString performance [v9]

2023-09-12 Thread 温绍锦
On Tue, 12 Sep 2023 17:53:47 GMT, ExE Boss wrote: >> 温绍锦 has updated the pull request incrementally with one additional commit >> since the last revision: >> >> merge from master > > src/java.base/share/classes/java/time/LocalTime.java line 141: > >> 139: @Stable >> 140: static final

Re: RFR: 8315999: Improve Date toString performance [v10]

2023-09-12 Thread 温绍锦
On Wed, 13 Sep 2023 01:15:38 GMT, 温绍锦 wrote: >> improve date toString performance, includes: >> >> java.util.Date.toString >> java.util.Date.toGMTString >> java.time.Instant.toString >> java.time.LocalDate.toString >> java.time.LocalDateTime.toString >> java.time.LocalTime.toString > > 温绍锦 has u

Re: RFR: 8315999: Improve Date toString performance [v9]

2023-09-12 Thread 温绍锦
On Tue, 12 Sep 2023 23:08:25 GMT, Claes Redestad wrote: >> 温绍锦 has updated the pull request incrementally with one additional commit >> since the last revision: >> >> merge from master > > src/java.base/share/classes/jdk/internal/util/DecimalDigits.java line 77: > >> 75: >> 76: static {

Re: RFR: 8315999: Improve Date toString performance [v10]

2023-09-12 Thread 温绍锦
> improve date toString performance, includes: > > java.util.Date.toString > java.util.Date.toGMTString > java.time.Instant.toString > java.time.LocalDate.toString > java.time.LocalDateTime.toString > java.time.LocalTime.toString 温绍锦 has updated the pull request incrementally with one additional

Re: RFR: 8315999: Improve Date toString performance [v9]

2023-09-12 Thread Claes Redestad
On Tue, 12 Sep 2023 17:23:00 GMT, 温绍锦 wrote: >> improve date toString performance, includes: >> >> java.util.Date.toString >> java.util.Date.toGMTString >> java.time.Instant.toString >> java.time.LocalDate.toString >> java.time.LocalDateTime.toString >> java.time.LocalTime.toString > > 温绍锦 has u

Re: RFR: 8315999: Improve Date toString performance [v9]

2023-09-12 Thread Claes Redestad
On Tue, 12 Sep 2023 13:10:42 GMT, 温绍锦 wrote: >> Of course, the optimization of DateTimeFormatter is more general, and we can >> spend time doing it later. The format of toString is fixed, we can not use >> DateTimeFormatter. > >> Have you considered potentially more generalizable optimizations

Re: RFR: 8315999: Improve Date toString performance [v9]

2023-09-12 Thread Claes Redestad
On Mon, 11 Sep 2023 16:13:01 GMT, 温绍锦 wrote: >> It was a suggestion, implicitly paired with removing ` + (year < 0 ? 1 : 0)` >> from line 2188. > > The reason for not using off++ is that it can be executed out of order, which > may result in better performance. I don't think that would outweig

Re: RFR: 8315999: Improve Date toString performance [v9]

2023-09-12 Thread ExE Boss
On Tue, 12 Sep 2023 17:23:00 GMT, 温绍锦 wrote: >> improve date toString performance, includes: >> >> java.util.Date.toString >> java.util.Date.toGMTString >> java.time.Instant.toString >> java.time.LocalDate.toString >> java.time.LocalDateTime.toString >> java.time.LocalTime.toString > > 温绍锦 has u

Re: RFR: 8315999: Improve Date toString performance [v9]

2023-09-12 Thread 温绍锦
> improve date toString performance, includes: > > java.util.Date.toString > java.util.Date.toGMTString > java.time.Instant.toString > java.time.LocalDate.toString > java.time.LocalDateTime.toString > java.time.LocalTime.toString 温绍锦 has updated the pull request incrementally with one additional

Re: RFR: 8315999: Improve Date toString performance [v8]

2023-09-12 Thread 温绍锦
> improve date toString performance, includes: > > java.util.Date.toString > java.util.Date.toGMTString > java.time.Instant.toString > java.time.LocalDate.toString > java.time.LocalDateTime.toString > java.time.LocalTime.toString 温绍锦 has updated the pull request with a new target base due to a me

Re: RFR: 8315999: Improve Date toString performance [v7]

2023-09-12 Thread 温绍锦
On Tue, 12 Sep 2023 13:54:34 GMT, Roger Riggs wrote: > You haven't make the case for these changes, please describe the use cases > when performance is a significant constraint on application performance. The > changes largely just add more code to maintain without otherwise adding > sufficien

Re: RFR: 8315999: Improve Date toString performance [v7]

2023-09-12 Thread Roger Riggs
On Tue, 12 Sep 2023 13:05:19 GMT, 温绍锦 wrote: >> improve date toString performance, includes: >> >> java.util.Date.toString >> java.util.Date.toGMTString >> java.time.Instant.toString >> java.time.LocalDate.toString >> java.time.LocalDateTime.toString >> java.time.LocalTime.toString > > 温绍锦 has u

Re: RFR: 8315999: Improve Date toString performance [v7]

2023-09-12 Thread 温绍锦
On Mon, 11 Sep 2023 14:59:25 GMT, 温绍锦 wrote: >> The performance of optimizing DateTimeFormatter cannot be as fast as using >> ixed-length buffer directly. > > Of course, the optimization of DateTimeFormatter is more general, and we can > spend time doing it later. The format of toString is fixe

Re: RFR: 8315999: Improve Date toString performance [v7]

2023-09-12 Thread 温绍锦
> improve date toString performance, includes: > > java.util.Date.toString > java.util.Date.toGMTString > java.time.Instant.toString > java.time.LocalDate.toString > java.time.LocalDateTime.toString > java.time.LocalTime.toString 温绍锦 has updated the pull request incrementally with two additional

Re: RFR: 8315999: Improve Date toString performance [v5]

2023-09-11 Thread 温绍锦
> improve date toString performance, includes: > > java.util.Date.toString > java.util.Date.toGMTString > java.time.Instant.toString > java.time.LocalDate.toString > java.time.LocalDateTime.toString > java.time.LocalTime.toString 温绍锦 has updated the pull request incrementally with two additional

Re: RFR: 8315999: Improve Date toString performance [v6]

2023-09-11 Thread 温绍锦
> improve date toString performance, includes: > > java.util.Date.toString > java.util.Date.toGMTString > java.time.Instant.toString > java.time.LocalDate.toString > java.time.LocalDateTime.toString > java.time.LocalTime.toString 温绍锦 has updated the pull request incrementally with one additional

Re: RFR: 8315999: Improve Date toString performance [v4]

2023-09-11 Thread 温绍锦
> improve date toString performance, includes: > > java.util.Date.toString > java.util.Date.toGMTString > java.time.Instant.toString > java.time.LocalDate.toString > java.time.LocalDateTime.toString > java.time.LocalTime.toString 温绍锦 has updated the pull request with a new target base due to a me

Re: RFR: 8315999: Improve Date toString performance [v3]

2023-09-11 Thread 温绍锦
> improve date toString performance, includes: > > java.util.Date.toString > java.util.Date.toGMTString > java.time.Instant.toString > java.time.LocalDate.toString > java.time.LocalDateTime.toString > java.time.LocalTime.toString 温绍锦 has updated the pull request with a new target base due to a me

Re: RFR: 8315999: Improve Date toString performance [v2]

2023-09-11 Thread 温绍锦
On Mon, 11 Sep 2023 14:42:33 GMT, Claes Redestad wrote: >> this place doesn't need off++ > > It was a suggestion, implicitly paired with removing ` + (year < 0 ? 1 : 0)` > from line 2188. The reason for not using off++ is that it can be executed out of order, which may result in better perform

Re: RFR: 8315999: Improve Date toString performance [v2]

2023-09-11 Thread 温绍锦
On Mon, 11 Sep 2023 14:44:24 GMT, 温绍锦 wrote: >> improve date toString performance, includes: >> >> java.util.Date.toString >> java.util.Date.toGMTString >> java.time.Instant.toString >> java.time.LocalDate.toString >> java.time.LocalDateTime.toString >> java.time.LocalTime.toString > > 温绍锦 has u

Re: RFR: 8315999: Improve Date toString performance [v2]

2023-09-11 Thread 温绍锦
On Mon, 11 Sep 2023 14:54:57 GMT, 温绍锦 wrote: >> src/java.base/share/classes/java/time/Instant.java line 1355: >> >>> 1353: @Override >>> 1354: public String toString() { >>> 1355: return DateTimeFormatter.ISO_INSTANT.format(this); >> >> Have you considered potentially more gener

Re: RFR: 8315999: Improve Date toString performance [v2]

2023-09-11 Thread 温绍锦
On Mon, 11 Sep 2023 13:29:14 GMT, Claes Redestad wrote: >> 温绍锦 has updated the pull request incrementally with one additional commit >> since the last revision: >> >> fix LocalDate.getChars offset > > src/java.base/share/classes/java/time/Instant.java line 1355: > >> 1353: @Override >> 1

Re: RFR: 8315999: Improve Date toString performance [v2]

2023-09-11 Thread Claes Redestad
On Mon, 11 Sep 2023 14:38:28 GMT, 温绍锦 wrote: >> src/java.base/share/classes/java/time/LocalDate.java line 2181: >> >>> 2179: if (yearAbs < 1000) { >>> 2180: if (year < 0) { >>> 2181: buf[off] = '-'; >> >> `buf[off++] = '-';` > > this place doesn't need off++

Re: RFR: 8315999: Improve Date toString performance [v2]

2023-09-11 Thread 温绍锦
On Mon, 11 Sep 2023 13:50:30 GMT, Claes Redestad wrote: >> 温绍锦 has updated the pull request incrementally with one additional commit >> since the last revision: >> >> fix LocalDate.getChars offset > > src/java.base/share/classes/java/time/LocalDate.java line 2181: > >> 2179: if (year

Re: RFR: 8315999: Improve Date toString performance [v2]

2023-09-11 Thread 温绍锦
> improve date toString performance, includes: > > java.util.Date.toString > java.util.Date.toGMTString > java.time.Instant.toString > java.time.LocalDate.toString > java.time.LocalDateTime.toString > java.time.LocalTime.toString 温绍锦 has updated the pull request incrementally with one additional

Re: RFR: 8315999: Improve Date toString performance

2023-09-11 Thread Chen Liang
On Mon, 11 Sep 2023 13:45:43 GMT, 温绍锦 wrote: > After PR #15651 is merged, changes will be made based on the new API. Until > then, you can help review other changes. I mean, OpenJDK's GitHub bots has a special handling system that allows you to include code from #15651 in this PR: 1. Merge yo

Re: RFR: 8315999: Improve Date toString performance

2023-09-11 Thread Claes Redestad
On Mon, 11 Sep 2023 12:12:17 GMT, 温绍锦 wrote: > improve date toString performance, includes: > > java.util.Date.toString > java.util.Date.toGMTString > java.time.Instant.toString > java.time.LocalDate.toString > java.time.LocalDateTime.toString > java.time.LocalTime.toString As @liach says this

Re: RFR: 8315999: Improve Date toString performance

2023-09-11 Thread 温绍锦
On Mon, 11 Sep 2023 13:42:30 GMT, Chen Liang wrote: > I think you should make this a dependent of #15651, so you can change the > base branch of pr to `openjdk:pr/15651` and you can base your work off that > pull request too. After PR #15651 is merged, changes will be made based on the new API

Re: RFR: 8315999: Improve Date toString performance

2023-09-11 Thread Chen Liang
On Mon, 11 Sep 2023 12:12:17 GMT, 温绍锦 wrote: > improve date toString performance, includes: > > java.util.Date.toString > java.util.Date.toGMTString > java.time.Instant.toString > java.time.LocalDate.toString > java.time.LocalDateTime.toString > java.time.LocalTime.toString I think you should m

Re: RFR: 8315999: Improve Date toString performance

2023-09-11 Thread 温绍锦
On Mon, 11 Sep 2023 12:12:17 GMT, 温绍锦 wrote: > improve date toString performance, includes: > > java.util.Date.toString > java.util.Date.toGMTString > java.time.Instant.toString > java.time.LocalDate.toString > java.time.LocalDateTime.toString > java.time.LocalTime.toString @cl4es can you help

Re: RFR: 8315999: Improve Date toString performance

2023-09-11 Thread 温绍锦
On Mon, 11 Sep 2023 12:12:17 GMT, 温绍锦 wrote: > improve date toString performance, includes: > > java.util.Date.toString > java.util.Date.toGMTString > java.time.Instant.toString > java.time.LocalDate.toString > java.time.LocalDateTime.toString > java.time.LocalTime.toString @liach can you help

RFR: 8315999: Improve Date toString performance

2023-09-11 Thread 温绍锦
improve date toString performance, includes: java.util.Date.toString java.util.Date.toGMTString java.time.Instant.toString java.time.LocalDate.toString java.time.LocalDateTime.toString java.time.LocalTime.toString - Commit messages: - improve date toString performance, includes: Ch