Skip to content

Comments

feat(nimbus): cache users in NimbusExperimentChangeLogInline#13991

Merged
freshstrangemusic merged 1 commit intomainfrom
push-uzzpuswpkqtp
Nov 19, 2025
Merged

feat(nimbus): cache users in NimbusExperimentChangeLogInline#13991
freshstrangemusic merged 1 commit intomainfrom
push-uzzpuswpkqtp

Conversation

@freshstrangemusic
Copy link
Member

@freshstrangemusic freshstrangemusic commented Nov 18, 2025

Because:

  • the changelog admin inline queries all users for each changelog; and
  • we now have many more changelogs than we previously had, which has resulted in the admin page for experiments becoming unusable

this commit:

  • computes the list of users once and uses the same list for all
    changelog inlines, reducing the number of User model queries from O(N)
    to O(1).

Fixes #13990

Copy link
Contributor

@relud relud left a comment

Choose a reason for hiding this comment

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

should this have tests?

@freshstrangemusic freshstrangemusic force-pushed the push-uzzpuswpkqtp branch 3 times, most recently from 2f03ebd to 745db42 Compare November 19, 2025 04:29
@freshstrangemusic freshstrangemusic changed the title feat(nimbus): cache users in NimbusExperimentChangelogInline feat(nimbus): cache users in NimbusExperimentChangeLogInline Nov 19, 2025
@freshstrangemusic
Copy link
Member Author

should this have tests?

yeah probably.

Because:

- the changelog admin inline queries all users for each changelog; and
- we now have many more changelogs than we previously had, which has
  resulted in the admin page for experiments becoming unusable

this commit:

- computes the list of users once and uses the same list for all
  changelog inlines, reducing the number of User model queries from O(N)
  to O(1).

Fixes #13990
@freshstrangemusic freshstrangemusic added this pull request to the merge queue Nov 19, 2025
Merged via the queue into main with commit 5da0a90 Nov 19, 2025
17 checks passed
@freshstrangemusic freshstrangemusic deleted the push-uzzpuswpkqtp branch November 19, 2025 05:32
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.

Django Experiment Admin has N queries

2 participants