Closed Elaine-Krauss-TCG closed 1 month ago
Matt Travers commented: From CR, the trigger is not updating the can_delete for a report to false when adding a transaction to the report. Sending back to In Progress.
Matt Travers commented: The move of the can_delete() code to the create/update has slowed the performance of those actions significantly. Moving ticket back to In Progress to reassess strategy.
Sasha Dresden commented: I've reworked the logic of the trigger and it has significantly improved performance for me. Here's some results from Locust generating
223 83 97 100 84.12 72 117 1652 88 110 120 89.39 72 166 5035 100 120 140 101.39 72 199 10046 120 160 180 117.4 72 259 15007 130 190 220 133.96 72 378 18171 140 210 250 144.96 72 574 20000 150 260 320 156.4 72 771
Matt Travers commented: Passes CR. Sending to QA.
Shelly Wise commented: QA review consisted of visual inspection when interacting with reports was able to load the Manage Reports table, load individual reports, and add and view Report Memos without issue. DEV provided Locust generation as denoted.
QA Review Completed. Moved to Stage Ready.
Sprint accepted by Paul Clark during sprint review on 8/20/2024.
The report serializer can_delete() method needs refactoring to improve performance: https://github.com/fecgov/fecfile-web-api/blob/release/sprint-42/django-backend/fecfiler/reports/serializers.py#L144-L177
QA Notes
Provide performance results in the comments.
Following the changes, there should be no visible changes when interacting with reports. You should be able to load the Manage Reports table, load individual reports, and add and view Report Memos without issue.
FECFILE-1430
DEV Notes
The
to_representation
method in the report serializer has an out-sized impact on response times. The biggest factor here is thecan_delete
method, which can take upwards of 1,000ms to run when a committee has tens of thousands of transactions in it.Design
null
FECFILE-1430