As attachement, here's the patch (against rev 2132). It's local to
sqlalchemy/orm/, so:
cd /sqlalchemy/orm
patch -p0 attribute_cache.patch
About the patch itself:
1. the cache should be a WeakKeyDictionary
OK, done. Performances are still OK, differences between built-in dict are
i think that is a great idea !
can you make a patch for me ?
here are some things i think it should have:
1. the cache should be a WeakKeyDictionary, if possible, so that an
application which creates classes on the fly doesnt run out of memory.
this adds a micro-amount of overhead vs. a
instance changes get picked up. if you want the more simplistic
comparison method (i.e. using is), set up your PickleType with the
flag mutable=False.
You meant like this?
Column('content', PickleType, mutable=False)
thanks
sanjay
--~--~-~--~~~---~--~~
Sanjay wrote:
instance changes get picked up. if you want the more simplistic
comparison method (i.e. using is), set up your PickleType with the
flag mutable=False.
You meant like this?
Column('content', PickleType, mutable=False)
like this
Column('content',
hey good news, it was mostly something obvious. I now have the the
overall time running within 10% of the 0.2.8 test, and the inner time
is within 20%. It was another one of those debugger lines which I now
made conditional.
the other cause for the speed difference is related to the newer
what logging really needs is this:
logging.debug(lambda: %s - %s % (_get_data(x),_get_other_data(y))
and the lambda: doesnt execute if logging is disabled; which accounts
for a lot more than just doing the % operation or not, such as in my
case where i make calls out to _instance_str() to
Michael Bayer wrote:
also, I challenge your assertion that saying x and y or z is a
perlish thing (its a C and Java thing if anything); python 2.5 has just
added the y if x else z syntax which is essentially an official
version of the same thing.
Well, I wasn't really talking about 'x and
it is flawed for that reason yes. fine for non-empty strings though.
the new syntax is meant to do correctly what we *want* the x and y or z
thing to do.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy
you need to forward the *actual test program* which you are running. i
have tests for performance which generally show very minute speed
differences between 0.2 and 0.3. The logging statements can be sped up
by making them conditional and maybe removing some. but im really
curious to see what
made the same mod in EagerLoader in rev 2123, and added an eager load
profile. its about 30% slower than the same test run in 0.2.8 to load
25000 objects eagerly.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
10 matches
Mail list logo