Remove preinitialisation of Charset.availableCharsets() as StringHttpMessageConverter now uses it lazily
dsyer opened this issue · 2 comments
dsyer commented
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.
bclozel commented
dsyer commented
So if we fix this it doesn't need to be backported, I guess.