DEV Community

Discussion on: The Peregrine programming language - A Python-like language that's as fast as C.

Collapse
 
fultonm profile image
Michael Fulton

I was not aware Python was significantly slower than C in production. Usually people use Cypthon in production right

Collapse
 
along1x profile image
Andrew Long

What makes Python faster or slower in a production environment vs. a language like C isn't the choice of the interpretter per say (CPython vs PyPy), but the efficiency of certain design patterns or usage of highly optimized libraries in your production code. For example, if you're able to vectorize many of your operations (using numpy or pandas, for example), your code can perform much faster regardless of your interpretter selection.

Collapse
 
fultonm profile image
Michael Fulton • Edited

Interpreted will be slower than compiled in general because there’s more layers of execution between the code and CPU at runtime. Holding constant the design patterns and workload, Cython can equal C at runtime efficiency. Unlike CPython, Cython is a superset of Python (and C) which gets compiled with a standard C/C++ compiler. If a Python solution needs to be put into production with minimal effort, it’s often easier to compile it with Cython than rewrite it in a systems language.

Collapse
 
saptakbhoumik profile image
SaptakBhoumik

A native solution is better