Cache the local time zone calculation on Windows #1791
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On Windows 10+, combase.dll gets loaded, unloaded, then subsequently various COM-related functions called to initialize/deinitialize the system leading to performance degradation #1760
This "fix" here caches the value once. Obviously this won't work for long running apps, so ideally some kind of way knowing when to update the value are needed (like subscribing to time zone changes, or simply refreshing the value every once in a while).
In the mean time, this affects grpc for Windows where if grpc returns anything else than grpc::Status::OK it'll have to call this function. For processes running into grpc issues this means extra time added. It's also not a thing that normally would be caught, and I could not find benchmark for this case.
grpc/grpc#37766