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

Address Some Bullet Warnings / Optimise Mean Request Times #3440

Merged
merged 5 commits into from
Dec 11, 2024

Conversation

aaronskiba
Copy link
Contributor

Changes proposed in this PR:

  • Address bullet warnings for the following paths:
    • /super_admin/api_clients
    • /public_plans
    • org_admins/plans (Superuser only)

The following table compares the development branch to aaron/bullet-fixes by making requests to the various paths affected by this PR. The benchmarking was performed via ab - Apache HTTP server benchmarking tool alongside an older (May 2024) db dump from the production environment of DMP Assistant. In both cases, 100 consecutive requests were performed to each path and the recorded result is the mean request time (ms).

Example request:

$ ab -n 100 -k -C "_dmp_roadmap_session=COOKIE_VALUE" -l http://127.0.0.1:3000/PATH/TO/PAGE
Path mean request time (ms) before mean request time (ms) now % improvement
/super_admin/api_clients 2901 843 70.9
/public_plans 232 168 27.6
/org_admin/plans (as super_admin type user) 269 190 29.4

app/views/org_admin/plans/index.html.erb:
- .length loads the records into memory. Because we are eager-loading other tables (see code changes in app/controllers/org_admin/plans_controller.rb), this was triggering a "AVOID eager loading detected" Bullet warning. Because we are in fact making use of these related tables further in the code, the warnings themselves appear to be false-positives. However, the change to this file manages to suppresses the Bullet warnings, and is still very fast.
Copy link

</tr>
1 Error
🚫

Please include a CHANGELOG entry.

You can find it at [CHANGELOG.md](https://github.com/DMPRoadmap/roadmap/blob/main/CHANGELOG.md).

Generated by 🚫 Danger

@aaronskiba aaronskiba changed the title Address Some Bullet Warnings / Optimise Page Loads Address Some Bullet Warnings / Optimise Mean Request Times Jul 23, 2024
@aaronskiba aaronskiba removed the request for review from dstuckey-uoe December 11, 2024 22:29
@aaronskiba aaronskiba merged commit a5f5b53 into development Dec 11, 2024
7 of 8 checks passed
@aaronskiba aaronskiba deleted the aaron/bullet-fixes branch December 11, 2024 22:50
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.

2 participants