What are the risks (if any) of mixing Psyco in my project?

I am working on a large financial pricing application that does some lengthy calculations. We have defined some functions that can be accelerated by selectively using psyco. My guide asked for an estimate of the costs and benefits of adding psyco to our stack.

Given the critical nature of my project, this is unacceptable if "performance gains" could potentially reduce reliability. I read that using psyco gains additional performance at the cost of using more memory. I am worried this might be a problem.

I do it like this:

@psyco.proxy
def my_slow_function(xxx):

      

In all, we would expect psyco to be applied to no more than 15 functions - they are used very heavily. There are thousands of functions in this library, so it only affects a tiny subset of the code. All functions are small, mathematical and stateless.

  • There is probably a risk that there will be significantly more memory in this case.
  • Are there any other issues that can arise when adding this component to our long-established library?

FYI, Python 2.4.4 platform on Windows 32bit XP

UPDATE: It looks like the main potential risk is a program requiring more memory to run than before psyco was added, so ideally I would like to find a way to see if psyco is adding memory requirements changes to the system.

+2


source to share


2 answers


Why not try profiling it? Psyco has a fairly detailed log :

Memory usage: x + kb

Psyco's current value of how much memory it consumes for emitted machine code and support for data structures. This is a rough estimate of memory overhead (the + sign should remind you that this figure is greatly underestimated). Use this information to configure memory limits (section 3.2.2).



Note also that memory usage is configurable :

memorymax

Stop when the memory consumed by Psyco reaches the limit (in kilobytes). This limit includes memory consumed prior to starting this profiler.

+3


source


Psyco is a JIT compiler. If your function is inactive, then there should be almost no return other than more memory.



+2


source







All Articles