]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
remove intermediary _is_clone_of entries when cloning
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 16 Mar 2022 16:37:20 +0000 (12:37 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 17 Mar 2022 14:12:23 +0000 (10:12 -0400)
commitbb39c1606d211c1b5bd5a9cf294f0bf834f7f26c
treee65d24e6c938c7c36f88e5bc8e34521df288b12f
parentd7caa3c0bef64c710e45ed646756da65c4241bdd
remove intermediary _is_clone_of entries when cloning

Improvements in memory usage by the ORM, removing a significant set of
intermediary expression objects that are typically stored when a copy of an
expression object is created. These clones have been greatly reduced,
reducing the number of total expression objects stored in memory by
ORM mappings by about 30%.

note this change causes the tests to have a bit of a harder time with
GC, which we would assume is because mappings now have a lot more
garbage to clean up after mappers are configured.   it remains
to be seen what the long term effects of this are.

Fixes: #7823
Change-Id: If8729747ffb9bf27e8974f069a994b5a823ee095
(cherry picked from commit b8db80e9ea917e4770c78feff092044d386985c6)
doc/build/changelog/unreleased_14/7823.rst [new file with mode: 0644]
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/selectable.py
test/aaa_profiling/test_memusage.py
test/orm/test_hasparent.py
test/orm/test_session.py