Description
Original issue and PR
https://github.com/couchbase/couchbase-lite-core/pull/1572
Copied from the PR
Currently, RevTree._insertedData is copied as is when copying a RevTree.
Why is this a problem?
When a document is repeatedly updated, Revs start to be purged eventually. Also, Rev bodies that aren't needed anymore are removed.
RevTree._insertedData is only ever added to and copied, keeping more and more data unnecessarily alive with each update. This data occupies memory, and the work required to copy RevTree._insertedData starts to dominate save operations.
Task
Port the fix from master branch to lithium branch
https://github.com/couchbase/couchbase-lite-core/commit/7b47459416ae572fa5b884bd8c690195acd82986