]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Reduce import time overhead
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 2 Nov 2020 22:37:12 +0000 (17:37 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 3 Nov 2020 18:56:02 +0000 (13:56 -0500)
commitf016c1ac7f93d2f759aff53ec1494658efd7b496
tree83f3e05b83d30c93d1e0beaf175dac38d33f54c7
parente34886f137a3daf594d34cf5aa9b427de2ad6b98
Reduce import time overhead

* Fix subclass traversals to not run classes multiple times

* switch compiler visitor to use an attrgetter, to avoid
  an eval() at startup time

* don't pre-generate traversal functions, there's lots of these
  which are expensive to generate at once and most applications
  won't use them all; have it generate them on first use instead

* Some ideas about removing asyncio imports, they don't seem to
  be too signficant, apply some more simplicity to the overall
  "greenlet fallback" situation

Fixes: #5681
Change-Id: Ib564ddaddb374787ce3e11ff48026e99ed570933
13 files changed:
lib/sqlalchemy/engine/create.py
lib/sqlalchemy/event/attr.py
lib/sqlalchemy/sql/__init__.py
lib/sqlalchemy/sql/annotation.py
lib/sqlalchemy/sql/traversals.py
lib/sqlalchemy/sql/visitors.py
lib/sqlalchemy/util/__init__.py
lib/sqlalchemy/util/_concurrency_py3k.py
lib/sqlalchemy/util/_preloaded.py
lib/sqlalchemy/util/concurrency.py
lib/sqlalchemy/util/langhelpers.py
test/aaa_profiling/test_orm.py
test/profiles.txt