-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
make just one MethodTable #58131
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
base: master
Are you sure you want to change the base?
make just one MethodTable #58131
Conversation
This doesn't seem that awful. Would obviously speed up |
Wow, did not expect this to get implemented so fast! Benchmarking this will be interesting (by which I mean, I hope it's boring :) ). Agree that keeping lists of subtypes seems ok. Though I'm sure someone out there is constructing arbitrarily-long chains of subtypes in a loop 😂
I do think we'll need this; I'm pretty sure people use this feature. If it helps, we can shard the global method table based on some properties of the signature; no reason the single method table actually has to be a single MethodTable object. |
6467c56
to
5f6efef
Compare
5f6efef
to
c4d3ce8
Compare
Ensure a total split of constructors and non-constructors, so they do not end up seaching the opposing table. Instead cache all kind lookups as keyed by typename(Type). Not really needed on its own, but it avoids a minor performance regression in #58131.
Ensure a total split of constructors and non-constructors, so they do not end up seaching the opposing table. Instead cache all kind lookups as keyed by typename(Type). Not really needed on its own, but it avoids a minor performance regression in JuliaLang#58131.
c4d3ce8
to
0e51bdf
Compare
Most of the complexity here is because of the need to provide legacy support to the experimental external/overlay MethodTable, otherwise this would just be a simple renaming of Table->Cache, which would then have simply been unnecessary and made this PR very tiny. Oh well.
0e51bdf
to
898e1c1
Compare
Most of the complexity here is because of the need to provide legacy support to the experimental external/overlay MethodTable, otherwise this would likely just be a simple renaming of Table->Cache, which would then have simply been unnecessary and made this PR very tiny. Oh well.Fixes #57560
The remaining question is what to call this global singleton object for introspection. I currently use
Core.GlobalMethods
.the placeholder nameCore._
, but someone may object to that.The remaining failing test (in core) is due to the better optimized cache structure here being better specialized and optimized now, but not yet reimplementing the fallback we had before for that one specific case. The good news is that there is no longer any reason to limit this to that one specific case anymore, since we could now fix all similar cases too and make it generally applicable to them. The bad news is that we might need every supertype to contain a list of all of its possible subtypes so that we can efficiently walk to all of their caches, if we want to restore that case to functional.TODO:
Core._
to something else