Skip to content

Address Some Bullet Warnings / Optimise Mean Request Times - #3440

Merged
aaronskiba merged 5 commits into
developmentfrom
aaron/bullet-fixes
Dec 11, 2024
Merged

Address Some Bullet Warnings / Optimise Mean Request Times#3440
aaronskiba merged 5 commits into
developmentfrom
aaron/bullet-fixes

Conversation

@aaronskiba

Copy link
Copy Markdown
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
Pathmean request time (ms) beforemean request time (ms) now% improvement
/super_admin/api_clients290184370.9
/public_plans23216827.6
/org_admin/plans (as super_admin type user)26919029.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.
@github-actions

Copy link
Copy Markdown
</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

@aaronskibaaaronskiba changed the title Address Some Bullet Warnings / Optimise Page LoadsAddress Some Bullet Warnings / Optimise Mean Request TimesJul 23, 2024
@aaronskiba
aaronskiba removed the request for review from don-stuckeyDecember 11, 2024 22:29
@aaronskiba
aaronskiba merged commit a5f5b53 into developmentDec 11, 2024
@aaronskiba
aaronskiba deleted the aaron/bullet-fixes branch December 11, 2024 22:50
Sign up for freeto 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

@aaronskiba@benjaminfaure