MATLAB Compile Python, Matlab and Python

  • Thread starter Thread starter Winzer
  • Start date Start date
  • Tags Tags
    Matlab Python
AI Thread Summary
Python can be optimized for performance through tools like Psyco and PyPy, which may help compile Python code to improve processing speed. When comparing processing speeds for large data arrays among Python (with NumPy and SciPy), MATLAB, and Mathematica, the results depend heavily on the specific tasks and optimizations applied to the code. Memory usage and overhead are critical factors that can influence performance across these platforms. Additionally, Python code can interact with C++ applications through communication methods like sockets, rather than direct compilation into machine code. Overall, the choice of language and optimization techniques will significantly impact processing efficiency.
Winzer
Messages
597
Reaction score
0
1) I know that python is an interpreted language. But is there a way to compile to code to make it process faster?

2) Suppose I have a huge array of data. I want to process it. If I were to run the process through python(with numpy and scipy), Matlab, and Mathematica which one would be able to process it the fastest?
 
Physics news on Phys.org
Winzer said:
1) I know that python is an interpreted language. But is there a way to compile to code to make it process faster?

You might look into http://psyco.sourceforge.net/ .
I have no experience with it. Please report back if it works.

2) Suppose I have a huge array of data. I want to process it. If I were to run the process through python(with numpy and scipy), Matlab, and Mathematica which one would be able to process it the fastest?

I think the answer to this really depends on
what specific tasks you want done
and how optimized your program is [with respect to the platform chosen].

You may have to also consider memory usage for your data (including data structures) and memory usage and overhead for the running program.
 
robphy said:
You might look into http://psyco.sourceforge.net/ .
I have no experience with it. Please report back if it works.
I think the answer to this really depends on
what specific tasks you want done
and how optimized your program is [with respect to the platform chosen].

You may have to also consider memory usage for your data (including data structures) and memory usage and overhead for the running program.
Thank you. Psyco looks very interesting. So does PyPy.

Another question is:
If compilers convert Java,C++,C to the same machine code(I don't know if they really do), and if I were to use a program to compile some Python file into machine code, could I use that code in some C++ application?
 
If you're looking to compile into an executable, and are on windows, check http://www.py2exe.org/

What do you mean by use some python code in c++? If you mean to have your python script talk with your c++ program, you can simply have them communicate through sockets.
 
Back
Top