- callcount

- more inlining
This commit is contained in:
Mike Bayer
2010-12-09 20:20:23 -05:00
parent 5622cfd5ec
commit 67259bfef1
3 changed files with 13 additions and 9 deletions
+9 -7
View File
@@ -1833,13 +1833,15 @@ class Mapper(object):
if primary_key is not None:
# set primary key attributes
for i, col in enumerate(mapper._pks_by_table[table]):
if mapper._get_state_attr_by_column(
state, state_dict, col) \
is None and len(primary_key) > i:
mapper._set_state_attr_by_column(
state, state_dict, col,
primary_key[i])
for pk, col in zip(primary_key, mapper._pks_by_table[table]):
# TODO: make sure this inlined code is OK
# with composites
prop = mapper._columntoproperty[col]
if state_dict.get(prop.key) is None:
# TODO: would rather say:
# state_dict[prop.key] = pk
# here, one test fails
prop._setattr(state, state_dict, pk, col)
mapper._postfetch(uowtransaction, table,
state, state_dict, c,
+1 -1
View File
@@ -124,7 +124,7 @@ class ColumnProperty(StrategizedProperty):
get_committed_value(state, dict_, passive=passive)
def _setattr(self, state, dict_, value, column):
state.get_impl(self.key).set(state, dict_, value, None)
state.manager[self.key].impl.set(state, dict_, value, None)
def merge(self, session, source_state, source_dict, dest_state,
dest_dict, load, _recursive):
+3 -1
View File
@@ -79,7 +79,9 @@ class MergeTest(_base.MappedTest):
# using sqlite3 the C extension took it back up to approx. 1257
# (py2.6)
@profiling.function_call_count(1257, versions={'2.4': 807})
@profiling.function_call_count(1257,
versions={'2.6+cextension':1194, '2.4': 807}
)
def go():
p2 = sess2.merge(p1)
go()