Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch Ancestry::InstanceMethods#ancestor_ids
In many methods, this is generated twice because the result is never saved. This simply adds memoization to the result of this method. Of Note: The extra `#clear_memoized_instance_variables` additions were necessary to fix failing tests due to ancestry records being updated and saved, and the `@_ancestor_ids` value became out of date. * * * Before/After ------------ **Note:** Only the totals here change... which is a bit weird and I didn't notice it before (probably just a reporting error on MemoryProfiler's end), but this patch was the only thing changed between the two runs. Total allocated: 316196585 bytes (2917071 objects) | Total allocated: 307262021 bytes (2762757 objects) ^^^^^^^ | ^^^^^^^ | allocated objects by gem | allocated objects by gem ----------------------------------- | ----------------------------------- 1576834 activerecord-5.0.7 | 1559102 activerecord-5.0.7 477120 manageiq/app | 477120 manageiq/app 274449 activemodel-5.0.7 | 274449 activemodel-5.0.7 208479 manageiq/lib | 106559 activesupport-5.0.7 106557 activesupport-5.0.7 | 82799 pending 82799 pending | 74117 ruby-2.3.3/lib 74117 ruby-2.3.3/lib | 71895 manageiq/lib 52875 manageiq-providers-vmware-0be2f13a0dc9 | 52875 manageiq-providers-vmware-0be2f13a0dc9 35578 ancestry-2.2.2 <<<<<<<<<< | 35578 ancestry-2.2.2 <<<<<<<< ... | ...
- Loading branch information