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

Optimize push-list endpoint #7817

Merged
merged 2 commits into from
Sep 28, 2023
Merged

Conversation

vrigal
Copy link
Collaborator

@vrigal vrigal commented Sep 27, 2023

Changes

  • Related commits (revisions in the serializer) are now prefetched, but not limited to 20 results as before (django does not supports slicing a prefetch, but it is possible in SQL)
    • Avoids 1 SQL request per Push
    • 35516 / 1260041 Push entries are linked to more than 20 commits. 8 are linked to ~10k commits.

Performance

  • Small data (/api/project/autoland/push/?full=true&count=100&fromchange=<rev_id>)

    • master : 569 ms ± 5.12 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
    • e6109c95: 520 ms ± 4.65 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
    • Approx 9% time reduction
  • Large data (/api/project/autoland/push/?full=true&count=100)

    • master : 5.69 s ± 63.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
    • e6109c95: 1.87 s ± 69.5 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
    • Approx 66% time reduction

@codecov-commenter
Copy link

codecov-commenter commented Sep 27, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (b16dbb9) 76.84% compared to head (e6109c9) 76.84%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7817      +/-   ##
==========================================
- Coverage   76.84%   76.84%   -0.01%     
==========================================
  Files         537      537              
  Lines       26556    26554       -2     
  Branches     3359     3359              
==========================================
- Hits        20408    20406       -2     
  Misses       5983     5983              
  Partials      165      165              
Files Coverage Δ
tests/push_health/test_compare.py 100.00% <100.00%> (ø)
treeherder/push_health/usage.py 100.00% <100.00%> (ø)
treeherder/webapp/api/serializers.py 87.86% <100.00%> (-0.29%) ⬇️
treeherder/webapp/api/push.py 58.29% <80.00%> (+0.18%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Archaeopteryx Archaeopteryx merged commit d27d0c3 into mozilla:master Sep 28, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants