Changes between Version 2 and Version 3 of PsycoMiddleware


Ignore:
Timestamp:
Feb 23, 2007, 10:59:37 AM (17 years ago)
Author:
Mrts
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PsycoMiddleware

    v2 v3  
    1414        return None
    1515}}}
     16
     17Note that this should only be used on 32bit systems. See http://www.alrond.com/en/2007/jan/25/performance-test-of-6-leading-frameworks .
     18
     19One possible way to determine this automatically:
     20{{{
     21#!python
     22from platform import architecture
     23
     24if architecture()[0] != '32bit':
     25    raise Exception("Don't use this on non-32-bit platforms")
     26
     27class PsycoMiddleware(object):
     28    """
     29    This middleware enables the psyco extension module which can massively
     30    speed up the execution of any Python code.
     31    """
     32    def process_request(self, request):
     33        try:
     34            import psyco
     35            psyco.profile()
     36        except ImportError:
     37            pass
     38        return None
     39}}}
Back to Top