On Thu, 2 Oct 2025 03:08:32 GMT, Shaojin Wen <[email protected]> wrote:

>> I propose to make j.t.f.DateTimePrintContext immutable.
>> 
>> Currently, DateTimePrintContext has only one mutable field, optional. This 
>> can be replaced by adding an optional parameter to the 
>> DateTimeFormatter.formatTo method.
>> 
>> Immutable DateTimePrintContext can be optimized by escape analysis, such as 
>> immutable object optimization.
>
> Shaojin Wen has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Improve javadoc for optional parameter in DateTimePrinterParser#format 
> method

Creating a DateTimePrintContext during the formatting process also has a 
disadvantage: it is difficult to perform manual unrolling performance 
optimizations like the draft PR #26807 I submitted, and it also makes automatic 
unrolling by the C2 JIT more difficult.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/26913#issuecomment-3361498045

Reply via email to