Skip to content
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

app/perf: reduce round trips during sync by N_{sources} - 1 #709

Merged
merged 1 commit into from
Jan 21, 2020

Conversation

redshiftzero
Copy link
Contributor

Description

Closes #689

Related to @rmol's investigation in #648, we need to reduce the total number of round trips per sync. On master the number of calls during sync is scaling as N_{sources}, this reduces it to a constant (3 calls, one to each of the reply, source (still too slow due to the gpg keys but we will need to handle some server side changes first), and submission endpoints).

Test Plan

Start server (NUM_SOURCES=20 make dev - this NUM_SOURCES env var adds sources with 2 submissions and 2 replies per source), run this branch.

Instead of a bunch of individual API calls for submission metadata, one per source:

[18/Jan/2020 05:46:29] "GET /api/v1/sources/cf74425f-d8a0-4ba3-8949-31cd208db210/submissions HTTP/1.1" 200 -

you'll see just one for submission metadata:

[18/Jan/2020 05:43:34] "GET /api/v1/submissions HTTP/1.1" 200 -

Checklist

If these changes modify code paths involving cryptography, the opening of files in VMs or network (via the RPC service) traffic, Qubes testing in the staging environment is required. For fine tuning of the graphical user interface, testing in any environment in Qubes is required. Please check as applicable:

  • I have tested these changes in the appropriate Qubes environment
  • I do not have an appropriate Qubes OS workstation set up (the reviewer will need to test these changes)
  • These changes should not need testing in Qubes

If these changes add or remove files other than client code, packaging logic (e.g., the AppArmor profile) may need to be updated. Please check as applicable:

  • I have submitted a separate PR to the packaging repo
  • No update to the packaging logic (e.g., AppArmor profile) is required for these changes
  • I don't know and would appreciate guidance

Copy link
Contributor

@kushaldas kushaldas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked as suggested. Approved

@rmol rmol merged commit 4c48c05 into master Jan 21, 2020
SecureDrop Team Board automation moved this from Ready for Review to Done Jan 21, 2020
@rmol rmol deleted the perf-api-get-sources branch January 21, 2020 19:38
@rmol rmol mentioned this pull request Jan 28, 2020
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

get all submissions in one API call
3 participants