Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zickgraf opened this issue Sep 26, 2023 · 0 comments

Comments

@zickgraf
Copy link
Member

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant