From a9b62055bfa61c11e9fe0b2984437e2c3e32bf0e Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 9 Mar 2020 17:12:35 -0400 Subject: Try to measure new style caching in the ORM, take two Supercedes: If78fbb557c6f2cae637799c3fec2cbc5ac248aaf Trying to see if by making the cache key memoized, we still can have the older "identity" form of caching which is the cheapest of all, at the same time as the newer "cache key each time" version that is not nearly as cheap; but still much cheaper than no caching at all. Also needed is a per-execution update of _keymap when we invoke from a cached select, so that Column objects that are anonymous or otherwise adapted will match up. this is analogous to the adaption of bound parameters from the cache key. Adds test coverage for the keymap / construct_params() changes related to caching. Also hones performance to a large extent for statement construction and cache key generation. Also includes a new memoized attribute approach that vastly simplifies the previous approach of "group_expirable_memoized_property" and finally integrates cleanly with _clone(), _generate(), etc. no more hardcoding of attributes is needed, as well as that most _reset_memoization() calls are no longer needed as the reset is inherent in a _generate() call; this also has dramatic performance improvements. Change-Id: I95c560ffcbfa30b26644999412fb6a385125f663 --- lib/sqlalchemy/sql/util.py | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/sqlalchemy/sql/util.py') diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py index 8d185ce7d..fae68da98 100644 --- a/lib/sqlalchemy/sql/util.py +++ b/lib/sqlalchemy/sql/util.py @@ -584,7 +584,6 @@ def splice_joins(left, right, stop_on=None): (right, prevright) = stack.pop() if isinstance(right, Join) and right is not stop_on: right = right._clone() - right._reset_exported() right.onclause = adapter.traverse(right.onclause) stack.append((right.left, right)) else: -- cgit v1.2.1