Skip to content

The more categories are created, the slower the creation of new categories gets #1469

Open
@zickgraf

Description

@zickgraf

Creating a category typically installs 10s or 100s of new methods. This makes the call to ResumeMethodReordering in Finalize slower and slower. This can lead to noticeable delays of some 100s of milliseconds or even seconds if more than 100 categories are created. The call to ResumeMethodReordering is only needed for the logic, which uses InstallTrueMethod, which in turn triggers method reordering. Using overhead := false avoids the problem, but also disables many unrelated and useful things. The problem is amplified by the fact that CAP methods are often installed multiple times, for example if cheaper derivations trigger (or even if a concrete derivation gets cheaper). Some actionable items:

  1. Avoid installing CAP methods multiple times, at least in the case where simply the same method is installed, only with a different weight.
  2. Allow to skip the logic part in Finalize with a more specific option than overhead := false. Note that even if the logic of a category is disabled, the logic part in Finalize has to be executed because the logic can be enabled at runtime. But maybe one could execute the logic part the first time the logic is enabled? Then we could maybe disable the logic by default.
  3. Think about removing the logic completely.

Metadata

Metadata

Assignees

No one assigned

    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