5 ms·
I've been recently using Python more rather than Java, and I find myself writing C more than ever. I always seem to find some speed/memory issue in my programs
by sbov 15y ago
I've been recently using Python more rather than Java, and I find myself writing C more than ever. I always seem to find some speed/memory issue in my programs that when rewritten in C goes away. Maybe I'm just not proficient enough in Python to avoid them yet. I would say its still a net gain over raw C.
- swah 15y agoIs it that easy to write in C and call from Python that you don't think twice about it?
- Kliment 15y agoYes, it actually is. Writing Python extensions in C was always easy, but now there's ctypes, and you don't even need to do that anymore. You can just call a shared library function directly from Python.
- lucian1900 15y agoYou might want to use a profiler first, then try PyPy. Then Cython.
- sbov 15y agoI didn't mean to imply I didn't profile (otherwise I wouldn't know what parts to write in C). I've been doing profiling (and trying various non-C ideas on what may help first). I'll have to look into PyPy and Cython, thanks.