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 performance #358

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Optimize performance #358

wants to merge 5 commits into from

Conversation

microstudi
Copy link
Contributor

@microstudi microstudi commented Dec 2, 2024

This is an attempt to improve performance in general when using Awesome, in some case can be noticable as is reported in #350

  • Memoize cache_hash for the overriden cell
  • Memoize AwesomeHelper at the global request object. This prevents to repeat queries as helpers in rails are different instances in each view

Depending on the context, I've been able to reduce view rendering time in the proposal index page:

no optimization memoize cache_hash memoize cache_hash and Helpers at class
11317ms 7927ms 5543ms

This number are in the development app, with no cache activated.
When cache is activated (bin/rails dev:cache) performance is even better than the original Decidim (until decidim/decidim#1370 is merged)

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 54.28571% with 16 lines in your changes missing coverage. Please review.

Project coverage is 66.52%. Comparing base (6c9476c) to head (c7866f1).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
lib/decidim/decidim_awesome/awesome_helpers.rb 33.33% 14 Missing ⚠️
...ecidim/decidim_awesome/proposal_l_cell_override.rb 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #358      +/-   ##
==========================================
- Coverage   68.85%   66.52%   -2.33%     
==========================================
  Files          80       72       -8     
  Lines        2106     1894     -212     
==========================================
- Hits         1450     1260     -190     
+ Misses        656      634      -22     

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

@microstudi microstudi marked this pull request as draft December 2, 2024 21:57
@microstudi microstudi linked an issue Dec 3, 2024 that may be closed by this pull request
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.

Weighted proposal voting causes slowness on proposals index page
1 participant