On Jun 11, 11:53 am, [EMAIL PROTECTED] wrote: > if u replace back the offending function with its plain pythonic > variant, will it work?
Which function do you mean? > 50% boost... just because of the python? u're constructing too many > queries over and over. No, the main module in which we have 50% performance boost is mostly "number crunching" code which Psyco optimizes very good. Though SA engine is called quite often, there are about 20 INSERTs per second. > try cache them, and reuse as building > blocks... - or cache their results... We use caching. BTW, something like builtin caching would be nice, eg. we have a few tables with practically constant content (they are like ENUM values) and they could be loaded once per application run. > e.g. on my model initialy i had 4500 queries constructed and issued, > after some caching they went to 4000 and then to about 1100. > Now they under 10... one big query for lots of objects instead of > thousands of small queries per-piece. And it is still near same model > which was made to allow efficient usage - but noone used that. I've also performed such optimizations, for me mapper's option were sufficient (mainly eagerloading for using LEFT OUTER JOINs). I must also be careful no to cache too aggressively, we have too much data to load all to RAM. In some places I use optimized (memory usage) classes for holding cache data, with __slots__ defined. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
