-
Notifications
You must be signed in to change notification settings - Fork 482
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
Cache subtypes to speed up selector dispatch #1440
Conversation
Unrelated to the PR, but this whole "Selector system" feels kinda odd to me. Using dynamic dispatch and reflection for what amounts to a "do this, then do this" construct seems quite complicated and slow. |
Yeah, would be good to get rid of it. I guess it just depends on whether any users are actually making use of it for extension purposes. (Edit: from a brief gh search there doesn't appear to be any usage, so after this long not having it made use of we could safely remove it without much problem. If anyone who is using it sees this please speak up.) |
@epatters did you also try the initial approach you outlined in #1438 (comment)?
|
@MichaelHatherly, I was originally going to try that, but then I realized it would fragment the |
Does this kind of undo #620?
DocumenterCitations.jl is an example that uses the selectors API for extending Documenter. But that shouldn't block us from improving it -- it's not, strictly, even part of the public API. |
Cool package. Looks pretty active, so probably best not to disrupt it too much if possible. |
Addresses #1438 by caching the results of the
subtypes
function. This PR reduces the runtime of the Catlab docs build from ~1 hr to 10 min.The approach taken here has the side effect that a selector cannot have more steps assigned to it after it has been dispatched at least once, but hopefully that is not a problem.