rtomayko/replicate — pull request #24 by rtomayko (2013-02-06 11:09:41+00:00)
Title: Dump faster with more predictable RES mem growth

This speeds up the dump process and makes it less prone to huge memory growth.

- [x] Reset association targets after following and dumping. Previously, all associated objects were kept around until their parent object was entirely dumped. Now objects are only kept around until their association is fully dumped.

- [x] Avoid loading associated objects when their replicant key already exists in the dump map. Previously, we'd load associated objects just to determine their key. In `belongs_to` cases, it's possible to discern this info from the reflection class and foreign key.

This gave a 12x speed up or so when dumping about 250K objects. About half due to each of reduced GC time and avoiding AR object creation.