5.1.2.3 Psycho

Psycho is a Python library that tries to guess the types of variables in a running Python program, then generate compiled extension code on the fly to optimize the running program. Sage does not use Psycho, because it only runs on Intel x86 machines, it has large and unpredictable memory requirements, and so much behind-the-scenes guessing at this level for a serious research mathematics tool is inappropriate.

Moreover, in my own experience with Sage, the speedups from Psycho were not significant, except on code that had an obvious C equivalent. Such code can be easily rewritten in Cython, which always results in something that is faster, more robust, and more reliable than what Pyscho produces, and which can be debugged using gdb.

Though Psycho is not included with or used by Sage, it is possible to try out Psycho by installing it and putting the appropriate line at the top of a file.

See About this document... for information on suggesting changes.