-
Notifications
You must be signed in to change notification settings - Fork 25.8k
MasterService#patchVersions is rather inefficient #77888
Copy link
Copy link
Closed
Labels
:Distributed/Cluster CoordinationCluster formation and cluster state publication, including cluster membership and fault detection.Cluster formation and cluster state publication, including cluster membership and fault detection.>bugTeam:DistributedMeta label for distributed team.Meta label for distributed team.
Description
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:
That's only ~7.5% of the total time on this otherwise busy master, but we could still cut this in half.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
:Distributed/Cluster CoordinationCluster formation and cluster state publication, including cluster membership and fault detection.Cluster formation and cluster state publication, including cluster membership and fault detection.>bugTeam:DistributedMeta label for distributed team.Meta label for distributed team.
Type
Fields
Give feedbackNo fields configured for issues without a type.
