You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove preinitialisation of Charset.availableCharsets() as StringHttpMessageConverter now uses it lazily #13423
I think BackgroundPreinitializer probably initializes Charset.availableCharsets() to avoid it happening in StringHttpMessageConverter. The internals of StringHttpMessageConverter changed in Spring 5 so that Charset.availableCharsets() is called lazily, so we probably don't have to pay this cost on startup in Spring boot 2.0, even in a background thread. It causes quite a bit of activity including GC pressure.
changed the title [-]BackgroundPreinitializer probably doesn't need to do Charset.availableCharsets() any more[/-][+]Remove preinitialisation of Charset.availableCharsets() as StringHttpMessageConverter now uses it lazily[/+]on Jun 19, 2018
Activity
bclozel commentedon Jun 8, 2018
For reference, the improvement in Spring Framework has been done in SPR-15502, and the Spring Boot change in #11570.
Tentatively scheduling this for 2.0.x.
dsyer commentedon Jun 8, 2018
So if we fix this it doesn't need to be backported, I guess.
Stop calling Charset.availableCharsets() early
[-]BackgroundPreinitializer probably doesn't need to do Charset.availableCharsets() any more[/-][+]Remove preinitialisation of Charset.availableCharsets() as StringHttpMessageConverter now uses it lazily[/+]