Skip to content

Remove preinitialisation of Charset.availableCharsets() as StringHttpMessageConverter now uses it lazily #13423

Closed

Description

@dsyer

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.

Activity

  1. added
    status: waiting-for-triage
    on Jun 8, 2018
  2. bclozel commented on Jun 8, 2018

    @bclozel
    Member

    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.

  3. added
    type: enhancement
    theme: performance
    and removed
    status: waiting-for-triage
    on Jun 8, 2018
  4. added this to the 2.0.x milestone on Jun 8, 2018
  5. dsyer commented on Jun 8, 2018

    @dsyer
    MemberAuthor

    So if we fix this it doesn't need to be backported, I guess.

  6. self-assigned this
    on Jun 13, 2018
  7. added a commit that references this issue on Jun 19, 2018
    7ae82b0
  8. modified the milestones: 2.0.x, 2.0.4 on Jun 19, 2018
  9. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

theme: performancetype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions