Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use frozen string literals and regex constants to reduce allocations
When doing operations on lots of models, strip_attributes can be responsible for a lot of small allocations for strings and regexes that do not change, but are nonetheless re-allocated every time a model is saved. Across thousands of records, this is a sizeable chunk of memory. Luckily, since the strings and regexes do not change, we can mark them as frozen and/or reference them via constants to avoid allocating them more than once.
- Loading branch information