Skip to content

Tracking values in MarkStep for processing later leads to poor performance #3069

Closed
@jtschuster

Description

@jtschuster

#3067 lead to me discovering that we spend too much time in the linker repeating checks when the conditions may not have changed. For example, we track virtual methods in _virtual_methods and each iteration of the process pipeline, we check every override of every virtual method to see if something changed such that it should be marked.

We could modify the behavior to check the override method only when one of its conditions has changed. For example, when a type is marked, we check all virtual methods on the type for the other criteria for keeping a virtual method (e.g., the base method is marked). Then if a virtual method is marked, we'd also check all the overriding methods to see if their types are instantiated. If so, we mark them right away, if not, they will get marked when the declaring type is marked as instantiated.

It seems like this may have been the original way MarkStep worked but got modified over time by people who didn't know about the convention (me).

_typesWithInterfaces and_interfaceOverrides also can follow this logic to improve performance.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions