Skip to content

(stable8.3) perf(polls): paginate poll list and load navigation counts separately - #5067

Merged
hamza221 merged 3 commits into
stable8.3from
perf/app-load
Oct 7, 2026
Merged

hamza221 merged 3 commits into
stable8.3from
perf/app-load

Conversation

@hamza221

@hamza221 hamza221 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What changed:

  • Added pagination
  • Only load the polls count instead of all polls for sidebar tabs
  • PollMapper::findForMe() narrows the candidates in SQL per category
    (access, owner, votes, expiry, relevance, view superset via EXISTS
    subqueries) vs Filtering client side

Impact -> Testing with a test instance with 10k fake polls in the db

Now:

  • Initial load -> 1.7s
  • Opening Participated (0 polls) -> Instant
  • Opening My polls (917 polls ) -> 0.404 s

Before:

  • Initial load -> 25.77 s
  • Opening Participated (0 polls) -> Instant
  • Opening My polls (917 polls ) -> instant

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

@hamza221
hamza221 changed the base branch from main to stable8.3 October 5, 2026 11:15
@hamza221 hamza221 changed the title Perf/app load (stable8.3) perf(polls): paginate poll list and load navigation counts separately Oct 5, 2026
Signed-off-by: hamza <hamzamahjoubi221@gmail.com>
@hamza221

hamza221 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Hello @dartcafe,
We need this performance fix along other fixes on the newly created stable8.3 branch for a customer who can't upgrade past 8.3.x
I also think this approach can help make polls more scalable for other versions too. as the app gets slow once you have access to a big number of polls (10k in this case).
The goal is to create fixes on this new stable branche then tag v8.3.11 from here. would you be okay with that or do you maybe have another preference.

@dartcafe

dartcafe commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

You can take over the stable-8 branch, because I think I will not be able to get further into it ATM, neither test it.

If you want to adopt it to the main branch, there is a toggle in the Polls admin settings to disable loading polls to the sidebar:
grafik

Since for most people the default behavior is no performance issue, an introduced pagination should be an admin setting.

@dartcafe dartcafe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Without further testing...

@hamza221

hamza221 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for the quick answer, I'll take care of the release for this branch

@hamza221

hamza221 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Since for most people the default behavior is no performance issue, an introduced pagination should be an admin setting.

I agree that this is a bit 'niche' I don't expect most users to have such big number of polls and face this issue, that's why I created the PR against stable8.3.

I'll see if a PR against main would make sense and propose it, if it does.

Signed-off-by: hamza <hamzamahjoubi221@gmail.com>
Signed-off-by: hamza <hamzamahjoubi221@gmail.com>
@hamza221
hamza221 marked this pull request as ready for review October 5, 2026 17:15
@hamza221
hamza221 merged commit cb59104 into stable8.3 Oct 7, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants