-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(Filters) - increase performance of updating charge filters (#2696)
## Description Based on profiling information we found out that the `to_h` method on ChargeFilter is called often when updating a charge with a large ( > 100) amount of filters. A second observation is that the `touch` method means we're updating all charge filters every time, which has poor performance when you have a lot of those for a given charge. ## Changes - cache `to_h` - updated_at is used for ordering the filters, but if you have > 100 we've chosen to optimize and not touch all records. This means stuff will change in the UI, but at that amount nobody is really managing them based on order.
- Loading branch information
Showing
3 changed files
with
16 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters