Skip to content

MasterService#patchVersions is rather inefficient #77888

@DaveCTurner

Description

@DaveCTurner

Today MasterService#patchVersions creates a new Metadata$Builder, increments the version, and then calls build() which expensively recomputes a bunch of data structures, e.g. Metadata#indicesLookup. This is quite inefficient, we could just copy those data structures from the previous Metadata and save a bunch of work and garbage-generation.

This is what it looks like in a flamegraph:

image

That's only ~7.5% of the total time on this otherwise busy master, but we could still cut this in half.

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Distributed/Cluster CoordinationCluster formation and cluster state publication, including cluster membership and fault detection.>bugTeam:DistributedMeta label for distributed team.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions