Skip to content

core: optimize list applications#18330

Merged
rissson merged 3 commits intogoauthentik:mainfrom
ryanpesek:optimize-applications-api
Dec 12, 2025
Merged

core: optimize list applications#18330
rissson merged 3 commits intogoauthentik:mainfrom
ryanpesek:optimize-applications-api

Conversation

@ryanpesek
Copy link
Contributor

@ryanpesek ryanpesek commented Nov 22, 2025

Attempt at optimizing applications api for users with a lot of groups and access to a lot of applications

Details

In my testing, the prefetch_related and select_related and modifications to the list() applications functions all brought moderate improvements. However, the caching of the user data instead of serializing the user again for each time get_launch_url is called brought massive improvements. Old behavior was 10s+ for a page of 100 applications and with all of these changes combined the new performance is 1-2s

Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • The code has been formatted (make web)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make docs)

@netlify
Copy link

netlify bot commented Nov 22, 2025

Deploy Preview for authentik-docs canceled.

Name Link
🔨 Latest commit f613c2c
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6932fc85b4ad0a00080ca215

@netlify
Copy link

netlify bot commented Nov 22, 2025

Deploy Preview for authentik-integrations canceled.

Name Link
🔨 Latest commit f613c2c
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6932fc85001b42000864dc3b

@codecov
Copy link

codecov bot commented Nov 23, 2025

Codecov Report

❌ Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.16%. Comparing base (31186ba) to head (f613c2c).
⚠️ Report is 107 commits behind head on main.

Files with missing lines Patch % Lines
authentik/core/api/applications.py 94.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #18330      +/-   ##
==========================================
- Coverage   93.21%   93.16%   -0.06%     
==========================================
  Files         933      933              
  Lines       51214    51233      +19     
==========================================
- Hits        47741    47733       -8     
- Misses       3473     3500      +27     
Flag Coverage Δ
e2e 44.73% <70.83%> (-0.02%) ⬇️
integration 22.76% <33.33%> (-0.05%) ⬇️
unit 91.44% <87.50%> (+<0.01%) ⬆️
unit-migrate 91.48% <87.50%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@ryanpesek ryanpesek changed the title core: optimize applications core: optimize list applications Nov 24, 2025
@rissson rissson self-assigned this Nov 24, 2025
@rissson rissson moved this from Todo to Needs review in authentik Core Nov 24, 2025
@rissson rissson requested a review from BeryJu November 26, 2025 17:24
@rissson rissson force-pushed the optimize-applications-api branch from b8197e7 to 2e6cb78 Compare November 26, 2025 17:27
@rissson rissson requested review from a team as code owners November 26, 2025 17:27
@rissson rissson changed the base branch from version-2025.10 to main November 26, 2025 17:27
@rissson rissson added the backport/version-2025.10 Add this label to PRs to backport changes to version-2025.10 label Nov 26, 2025
@rissson rissson added this to the Release 2025.10.3 milestone Nov 26, 2025
@BeryJu BeryJu removed request for a team November 27, 2025 13:09
@github-project-automation github-project-automation bot moved this from Needs review to In Progress in authentik Core Dec 5, 2025
@netlify
Copy link

netlify bot commented Dec 5, 2025

Deploy Preview for authentik-storybook canceled.

Name Link
🔨 Latest commit f613c2c
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6932fc8561dfb700088913d9

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
@rissson rissson requested a review from BeryJu December 5, 2025 15:39
@rissson rissson moved this from In Progress to Needs review in authentik Core Dec 5, 2025
@rissson rissson enabled auto-merge (squash) December 5, 2025 16:06
@rissson rissson merged commit 69b98fc into goauthentik:main Dec 12, 2025
96 checks passed
@github-project-automation github-project-automation bot moved this from Needs review to Done in authentik Core Dec 12, 2025
authentik-automation bot pushed a commit that referenced this pull request Dec 12, 2025
Co-authored-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
@authentik-automation
Copy link
Contributor

🍒 Cherry-pick to version-2025.10 created: #18791

rissson added a commit that referenced this pull request Dec 12, 2025
…10) (#18791)

Co-authored-by: Ryan Pesek <44002516+ryanpesek@users.noreply.github.com>
Co-authored-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
@ryanpesek ryanpesek mentioned this pull request Dec 12, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend backport/version-2025.10 Add this label to PRs to backport changes to version-2025.10

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants