[IPOL discuss] python as an addition to c++
Nicolas Limare
nicolas.limare at cmla.ens-cachan.fr
Thu Jun 6 08:45:50 CEST 2013
On Wed, Jun 05, 2013 at 08:22:11PM +0200, Miguel Colom wrote:
> Quoting Ofer <ofer.bartal at weizmann.ac.il>:
> >Matlab and python are both effective tools for fast prototyping, python
> >being the free choice of the two. For this reason, perhaps is would be a
> >language worthwhile to learn? :)
>
> A parallelized C/C++ as those we have in the current IPOL
> publications are complete programs that once compiled run at their
> fastest speed using CPU native instructions.
> They're only limited by the power of the machine where the run on.
I am no very sure of that, Miguel. We could also say that they are
very limited by the skills of the developper in low-level
optimizations. And sometimes the Python/NumPy internals will be better
coded than a researcher's C code, and the python version could be
faster. I'll try with a (simplistic) code of mine, to have some
numbers for a comparison.
I agree with you that Python, like Matlab, will not work for a class
of algorithms, like thoses with random exploration of an image or
patch-based methods. But it may good enough for other ones.
> the bytecode adds up a level of indirection and causes the Python
> programs to run much slower than a C/C++ program.
> Of course, when a function of numpy is called, the speed is similar
> to that of a C/C++ program, but only because the function numpy
> function is written in C/C++.
Using numpy should be considered the norm for computational algorithms
in Python; being written in C doesn't matter, all the Python core is
written in C too.
I will ask some Python experts about the stability and compatibility
issues explained in my previous mail. If a some stable version is
possible, then I think the only question remaining is if and how a
python code can be used by non-python researcher. The rest (sandboxing
and having reviewers) is only a internal matter for IPOL.
--
Nicolas LIMARE - CMLA - ENS Cachan http://limare.perso.math.cnrs.fr/
IPOL journal http://www.ipol.im/
-> image processing, reproducible research, open science
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <https://tools.ipol.im/mailman/archive/discuss/attachments/20130606/2e38c0f1/attachment-0001.pgp>
More information about the discuss
mailing list