Re: Request for Enhancement: java.io.Writer.of(Appendable) as an efficient alternative to java.io.StringWriter

2024-12-27 Thread Chen Liang
Hi Markus, I think the idea makes sense, but it comes with more difficulties than in the case of Reader.of. An Appendable is a higher abstraction modeling only the character writing aspects, without concerns with resource control (such as flush or close). One detail of note is that Writer itself i

Re: RFR: 8345668: ZoneOffset.ofTotalSeconds performance regression [v3]

2024-12-27 Thread Chen Liang
On Fri, 27 Dec 2024 16:27:10 GMT, Archie Cobbs wrote: >> For sure we should use result of `putIfAbsent`. Let's do this for all cases. >> See how it was implemented in my first commit - >> https://github.com/openjdk/jdk/pull/9208/commits/73a2f6cb1b91f4d7ee374089f35a72ef7b94433b > >> For sure we

Re: RFR: 8345668: ZoneOffset.ofTotalSeconds performance regression [v3]

2024-12-27 Thread Archie Cobbs
On Thu, 26 Dec 2024 17:25:55 GMT, Andrey Turbanov wrote: > For sure we should use result of `putIfAbsent` Drive-by comment... >From what i can infer, the performance regression being addressed here is >caused in part by the fact that (for example) >`ConcurrentHashMap.computeIfAbsent()` provid

Re: RFR: 8343251: Facelift for Type and AnnotatedType specifications [v7]

2024-12-27 Thread Chen Liang
On Thu, 5 Dec 2024 17:54:34 GMT, Chen Liang wrote: >> The Type and AnnotatedType hierarchies have been enigmatic to new users: >> users have no clue how to categorize arbitrary type objects, when it is safe >> to cast to more specific types, and the exact conditions for method >> contracts. >>