-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Serialization] Collapse indirection in DeclContextID #26813
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
[Serialization] Collapse indirection in DeclContextID #26813
Conversation
@swift-ci Please test |
@swift-ci Please test source compatibility |
For code size @swift-ci Please smoke benchmark |
…oh wait, that is code size rather than swiftmodule size. Oh well. |
Shaves 0.6% off of the stdlib compiled module for macOS, and 1% off the one for Foundation. |
This comment has been minimized.
This comment has been minimized.
What's the downside? That it replaces proven code with new code? |
Mainly that there's not a good common name for the un-templated function. |
4cab539
to
2f73f9a
Compare
@varungandhi-apple, any thoughts? Think I should wait for Brent to get back? @swift-ci Please smoke test |
...by making it a tagged union of either a DeclID or a LocalDeclContextID. This should lead to smaller module files and be slightly more efficient to deserialize, and also means that every AST entity kind is serialized in exactly one way, which allows for the following commit's refactoring.
No intended functionality change (other than a small reorder).
2f73f9a
to
6bd0421
Compare
@swift-ci Please smoke test |
...by making it a tagged union of either a DeclID or a LocalDeclContextID. This should lead to smaller module files and be slightly more efficient to deserialize, and also means that every AST entity kind is serialized in exactly one way, which allows factoring out a common loop in writing AST block entities.
I suggest reviewing each commit separately. I'm not entirely convinced the second one is worth it.