[sqlalchemy] Re: SA 0.3.x: performance issues = proposal

2006-12-08 Thread Sébastien LELONG
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

[sqlalchemy] Re: SA 0.3.x: performance issues = proposal

2006-12-06 Thread Michael Bayer
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

[sqlalchemy] Re: SA 0.3.x: performance issues

2006-12-05 Thread Sanjay
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 --~--~-~--~~~---~--~~

[sqlalchemy] Re: SA 0.3.x: performance issues

2006-12-05 Thread Michael Bayer
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',

[sqlalchemy] Re: SA 0.3.x: performance issues

2006-12-04 Thread Michael Bayer
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

[sqlalchemy] Re: SA 0.3.x: performance issues

2006-12-02 Thread Michael Bayer
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

[sqlalchemy] Re: SA 0.3.x: performance issues

2006-12-02 Thread Daniel Miller
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

[sqlalchemy] Re: SA 0.3.x: performance issues

2006-12-02 Thread Michael Bayer
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

[sqlalchemy] Re: SA 0.3.x: performance issues (forgot attachments)

2006-12-01 Thread Michael Bayer
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

[sqlalchemy] Re: SA 0.3.x: performance issues (forgot attachments)

2006-12-01 Thread Michael Bayer
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