2 ms·
Cython is basically C in Python syntax with some convenience features. Unless you know C it's not always worth using. Without doing any "C stuff" (i.e. just wr
by nerdponx 8y ago
Cython is basically C in Python syntax with some convenience features.
Unless you know C it's not always worth using. Without doing any "C stuff" (i.e. just writing Python and compiling with Cython) you get about a 50% speedup in tight loops; sometimes that's good enough, other times it's not.
To go any faster than that, you basically need to start writing C code, using the CPython API, using Cython's badly under-documented features for doing so.
- fspeech 8y agoFor me Cython truly shines when interfacing to C++.
- baldfat 8y agoLearning C to the point where you get Cython is pretty easy. C is much easier to pick up rather than the HUGE C++. Here is a video you can watch in an afternoon that would give you the general gist and covers the basics quickly. https://www.youtube.com/watch?v=KJgsSFOSQv0 https://www.youtube.com/watch?v=KJgsSFOSQv0