-
Notifications
You must be signed in to change notification settings - Fork 28
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
Weighted proposal voting causes slowness on proposals index page #350
Comments
I've been investigating a bit this and I couldn't replicate this degradation of performance. I've tested thge 0.28 version though. On the other hand, I don't see how this method generates a n+1 query, in any case just one more query per proposal (which effect is mostly negligible considering the amount of other queries around). But please, add more information if you can. Maybe this is relevant decidim/decidim#13701 |
@Quentinchampenois The backport for the version 0.27 is here: You thing you can try it in your environment? see if there's any gain? |
Thank you @microstudi for your time and the investigation ! I will try to run your optimization on my side to see differences 👍 |
Hey I tested locally your optimizations, here is what I got on v0.27 with 700 proposals and cache enabled : With a simple Gatling scenario and a ramp-up of 10 users in 20 seconds, executed 6 times, here is my observations:
To me your optimizations improve performances ! Applying changes made from |
You're right @Quentinchampenois I forgot to change the cell to the M type in the backport. I've applied it. This is one more optimization that can be done, but it is a little bit tricky. Is the one applied in this commit: f410f39 with this optimization, we memoize at the application level all the queries related to extra_fields and votes. This should reduce the queries from 3 per proposal displayed to just one and 2 extra grouped select for the memoization. If you can update your test with the latest commit and tell me the performance difference, we will see if it's worth it. |
Hello, I just tested with your latest changes and I can confirm that the 50th percentile is |
Thanks @Quentinchampenois unless you thing about any other optimization that could be done, I'll finish the specs and merge this |
Describe the bug
A clear and concise description of what the bug is.
Hello, I share with you slowness we had on a production instance. The feature Weighted proposal voting appears to really slow down the loading of the proposals index page.
I haven't investigate a lot but I think there is a query n+1 in the proposal_m_cell_override or caching issue maybe.
About the application :
release/0.27-stable
and commitc72e7f0fa0fe98807ace8414ecc08cbf44ce72d5
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
I expect the loading page to remain stable
Quick fix
Deactivate the feature
weighted_proposal_voting
if not used 👍Example:
config/initializers/decidim_awesome.rb
Example of rendering time when activating and disabling the feature :
The text was updated successfully, but these errors were encountered: