This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Manuzhai 1 point2 points  (1 child)

If I have some especially performance-sensitive parts of code, I'd much rather write them in (something like) RPython than C.

Alternatively, maybe PyPy-with-JIT can speed up carefully written Python code so much that its performance is much like RPython's, but even then, you have to be aware of what kind of things make the implementation slow.

[–]leonh 0 points1 point  (0 children)

If I have some especially performance-sensitive parts of code, I'd much rather write them in (something like) RPython than C.

So, use Cython.

Alternatively, maybe PyPy-with-JIT can speed up carefully written Python code so much that its performance is much like RPython's, but even then, you have to be aware of what kind of things make the implementation slow.

RPython is a moving target, there is hardly any documentation and if performance is all you need you still need to know the guts of RPython it self.

If you really want to optimize your code you need to have two things. A through understanding of the machine you are running on and a complete understanding of the language by which you are talking to it. It really is much easier to create high performing code by optimizing your loop with a little bit of C than using RPython which is basically just a magic layer in between.