-
Notifications
You must be signed in to change notification settings - Fork 25
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
Optimize CGrpcServer getters #1284
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1284 +/- ##
==========================================
- Coverage 87.45% 86.18% -1.28%
==========================================
Files 81 81
Lines 9234 9248 +14
==========================================
- Hits 8076 7970 -106
- Misses 1158 1278 +120 |
PProfizi
changed the title
Temporary fix for performance of ResultInfo.__str__() in LegacyGrpc
Cache ResultInfo get requests in LegacyGrpc
Nov 22, 2023
PProfizi
changed the title
Cache ResultInfo get requests in LegacyGrpc
Improve performance for remote
Nov 22, 2023
cbellot000
approved these changes
Nov 23, 2023
PProfizi
commented
Nov 23, 2023
cbellot000
approved these changes
Nov 23, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Edit: the actual issue was found to be too many gRPC calls to ResultInfo getters when using a
LegacyGrpcServer
. The solution found was to add a cache decorator to functions called repeatedly.We thus went down from 1004 gRPC calls waiting a total of
104s
, to 166 gRPC calls waiting a total of15s
.By looking at the
GrpcServer
calls, caching theos
andversion
properties also decreases total time from50s
to15s
.There may be further improvements to be made that I did not see with the simple
print(model)
command.NB: I did enforce a limit of 50 for the cache while testing, this is TBD
NB2: the first initiative consisting of improving the description given by the server could still be beneficial.
NB3: all changes related to gate have been made in a different PR server-side
Old:
Summary:
Upon arrival of Fluid results, the
ResultInfo.__str__
method was enhanced to also show the locations of each available result as they are dynamic, as well as create a map of qualifier names vs IDs, as well as properly detect the fluid physics type.This creates a performance deficit of 1200% when in LegacyGrpc (without any actual network delay) due to the number of requests made just when requesting for available results.
The goal of this PR is to revert to the server description of the
ResultInfo
when in LegacyGrpc to bypass this performance bottleneck, while server-side changes are to be made to:ResultInfo
in all cases, potentially with some very minor formatting