-
Notifications
You must be signed in to change notification settings - Fork 9
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
perf: use batch loading for BasicUserDetails #932
base: develop
Are you sure you want to change the base?
Conversation
"localRoot": "${workspaceFolder}", | ||
"remoteRoot": "C:\\app" | ||
"localRoot": "${workspaceFolder}/apps/backend", | ||
"remoteRoot": "/app" |
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 gets rid of our old windows container debug profile and replaces it with the newer one that our debug instructions on confluence advise putting here. Once this merges in, that section will need to be updated https://user-office-project.atlassian.net/wiki/spaces/UOP/pages/19136712/STFC+development+workflow#Debugging-the-backend
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 good to me. Out of interest if the number of calls to the UOWS is cut down by a half does that mean only 2 people are being batch loaded at a time?
Seems like it. I guess the batching might be done at a more local level within each query, like if we're loading proposals on the panel one by one, it's probably not the fastest to batch up and only request the reviewers at the very end. Plus there's likely going to be a lot of repeats in the reviewers requested in the panel, so a lot of requests are already be dealt with and reduced in the initial unbatched case by the caching. |
Description
Expands the user batch loading from #469 to apply to BasicUserDetails as well, since the basic variant is quite widely used, and thus causes a lot of calls to the slow external user service at STFC. By combining multiple external calls into one we'll have to pay the time penalty of making network calls fewer times, and when that's ~100ms for each call in our prod environment, it'll add up to quite a bit of user-data-heavy requests.
Motivation and Context
How Has This Been Tested
I made 3 local page loads of access panel 11's assignments, recording the time taken by the main 3 calls when starting with an empty users cache. Due to react's dev setup making calls twice, this results in 6 calls for each. For those runs I also tracked the number of UOWS calls made. All times are in milliseconds
Fixes
Closes UserOfficeProject/issue-tracker#1197
Changes
Depends on
UserOfficeProject/mock-uows#19
While the test suite as a whole is passing here, some tests in isolation would have failed without this update to the mock uows, which has already merged. The initial passing state was I believe due to requests for individual users being made first in other tests and then cached in the backend. Without that, any test that first requests multiple users with batch loading would have failed as the mock server would only give one user's details.
Tests included/Docs Updated?