Using C/C++ for heavy calculations in Python (Also MySQL) -


I am implementing an algorithm in my Python Web application, and it involves involving some (potential) large clustering and matrix calculations. I have seen that Python could use C / C ++ libraries, and thought that it might be a good idea to use it to speed things up.

First of all: Do not have any reason while doing this, or should I keep in mind anything?

Second: I have some reluctance to connect with MySQL (where I will get data calculation).

Use the ecosystem.

For matrix, using numpy and scipy can provide almost the same functionality, such as tools like Matlab. If you learn to write idiomatic code with these modules, then the internal end of the module can be in C or Fortran implementation, which results in the overall performance of C-like overall performance with Python expression. You may also be interested in numexpr, which can move forward and in some cases parallel to sample / sippy expressions.

If you need to type the intense inner end in Python, you may be able to make this problem more suitable for nodi / Sippy. Or, perhaps you can use the data structure available in Python to come up with a better algorithm rather than the faster implementation of the same algorithm. If not, it is the statement, which uses a restricted subset of Python to compile the machine code.

As a last resort, and after profiling to identify complete bad hurdles, should you write an extension module C / C ++ There are very easy ways to fulfill the vast majority of performance requirements, and the numerical / mathematical code is an area with very good current library support.


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -