-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Localization] Delay loading localization on startup #36705
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
[Localization] Delay loading localization on startup #36705
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not exactly what we have discussed. I still don't think there is any need to save locale/path in the DiagnosticEngine
, I think that belongs to LocalizationProducer
as does most of the logic contained by DiagnosticEngine::setLocalization
.
be18874
to
1dd38e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks much better now, I have left some more comments inline.
- Add `LocalizationProducerState` to manage the states of LocalizationProducers. - Add `initializeImpl` and `initializeIfNeeded` to manage lazily initialization of `LocalizationProducer`s. - Move constructing a localization producer from DiagEngine to `LocalizationProrducer` itself.
c900057
to
481b29b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you!
@swift-ci please test |
Build failed |
@swift-ci please clean test Linux platform |
Build failed |
@swift-ci please test Linux platform |
We were loading localization files on start-up, but now we need to stop loading them and instead load them when first diagnostic is requested, so there is no startup overhead for the compiler on projects without errors.
cc @xedin