summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-02-18 15:58:46 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2015-02-18 15:58:46 -0500
commit6d3295772eba78e4a197fec9d84dc7e396a28d5c (patch)
tree9e8c3eec3d38eec40ee921b41af96713cc0d0f4d
parent6436664bb7c264f7db038a8487cb9d3465673d42 (diff)
downloadsqlalchemy-faster_expiry.tar.gz
- changelog etc, forgot to remove assertionfaster_expiry
-rw-r--r--doc/build/changelog/changelog_10.rst10
-rw-r--r--lib/sqlalchemy/orm/instrumentation.py7
-rw-r--r--lib/sqlalchemy/orm/session.py2
-rw-r--r--lib/sqlalchemy/orm/state.py2
4 files changed, 12 insertions, 9 deletions
diff --git a/doc/build/changelog/changelog_10.rst b/doc/build/changelog/changelog_10.rst
index 85681fbba..48b94c07a 100644
--- a/doc/build/changelog/changelog_10.rst
+++ b/doc/build/changelog/changelog_10.rst
@@ -24,6 +24,16 @@
on compatibility concerns, see :doc:`/changelog/migration_10`.
.. change::
+ :tags: feature, orm
+ :tickets: 3307
+
+ Mapped state internals have been reworked to allow for a 50% reduction
+ in callcounts specific to the "expiration" of objects, as in
+ the "auto expire" feature of :meth:`.Session.commit` and
+ for :meth:`.Session.expire_all`, as well as in the "cleanup" step
+ which occurs when object states are garbage collected.
+
+ .. change::
:tags: bug, mysql
The MySQL dialect now supports CAST on types that are constructed
diff --git a/lib/sqlalchemy/orm/instrumentation.py b/lib/sqlalchemy/orm/instrumentation.py
index cce13f356..78a573cfd 100644
--- a/lib/sqlalchemy/orm/instrumentation.py
+++ b/lib/sqlalchemy/orm/instrumentation.py
@@ -110,13 +110,6 @@ class ClassManager(dict):
attr.impl for attr in
self.values() if attr.impl.accepts_scalar_loader])
- @_memoized_key_collection
- def _non_scalar_loader_keys(self):
- return frozenset([
- attr.key for attr in self.values()
- if not attr.impl.accepts_scalar_loader
- ])
-
@util.memoized_property
def mapper(self):
# raises unless self.mapper has been assigned
diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py
index 55b19749e..c47026969 100644
--- a/lib/sqlalchemy/orm/session.py
+++ b/lib/sqlalchemy/orm/session.py
@@ -2691,7 +2691,7 @@ def make_transient(instance):
if s:
s._expunge_state(state)
- # remove expired state and
+ # remove expired state
state.expired_attributes.clear()
# remove deferred callables
diff --git a/lib/sqlalchemy/orm/state.py b/lib/sqlalchemy/orm/state.py
index 8aa6fbe5f..7691c9826 100644
--- a/lib/sqlalchemy/orm/state.py
+++ b/lib/sqlalchemy/orm/state.py
@@ -266,7 +266,7 @@ class InstanceState(interfaces.InspectionAttr):
# we can't possibly be in instance_dict._modified
# b.c. this is weakref cleanup only, that set
# is strong referencing!
- assert self not in instance_dict._modified
+ # assert self not in instance_dict._modified
self.session_id = self._strong_obj = None
del self.obj