On Mon, 20 Jan 2025 13:51:22 GMT, Alan Bateman <al...@openjdk.org> wrote:

>> Vladimir Ivanov has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   8346230 [perf] scalability issue for the specjvm2008::xml.transform 
>> workload
>
> src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java
>  line 53:
> 
>> 51:      * Cache of XMLReader objects
>> 52:      */
>> 53:     private volatile ThreadLocal<ReaderWrapper> m_readers;
> 
> It's not very common to see a ThreadLocal as an instance field but here it's 
> more like a TL per XMLReaderManager instance. Is there any reason why this 
> can't be eagerly created and use a final field here?

Yeah, a final static field would be good, though no harm was done in this case 
as the reader manager is a singleton. But final and then eagerly created would 
be better, get and release only need to reset states.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23185#discussion_r2013002400

Reply via email to