On Sun, Feb 19, 2012 at 12:48 AM, Michael Bayer <mike...@zzzcomputing.com> wrote: > Optimizing InstanceState while maintaining it's current behavioral contract > exactly would be a lot more straightforward, requiring no complications to > internals, API or documentation story. Methods here include experimenting > with various forms of inlining inside of __setstate__() (such as inlining the > call to setup_instance() when the default instrumentation manager is in use) > as well as experimenting with a C port. There's not much that happens inside > of __setstate__() as it is.
I've managed quite efficient inlining with bytecode magic. It's especially effective with SQLA code, since it also specializes the inlined function, removing a lot of dead code (in the call context). I never actually need it, since SQLA is not my bottleneck, but it may be an interesting approach. I could share the code if you're interested, but it is rather hard to maintain (it's tied to the bytecode, which is version-specific in CPython) and it's experimental code, so it's rather ugly. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.