0
$\begingroup$

Rosanswers logo

Will ROS2 (rclpy, etc.) support PyPy which would enable better performance?


Originally posted by thinwybk on ROS Answers with karma: 468 on 2018-05-23

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

There's no plan to do so, no. But anyone from the community could try to get it working. We do, however, make heavy use of C extensions, so I don't know well those integrate into PyPy. Last time I looked at it, PyPy only supported FFI-like bindings. Our current implementation uses CPython directly from C code to create PyObjects and stuff like that.


Originally posted by William with karma: 17335 on 2018-05-23

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by thinwybk on 2018-05-23:
What's your estimated effort for rclpy only? :)

Comment by William on 2018-05-23:
I have no idea. Assuming you go with the CFFI route (reusing our C API), you'll still have to write a lot of conversion code in Python and deal with generate messages (not sure if the generated Python messages will work as-is). It might be a considerable effort, but I don't know for sure.

Comment by thinwybk on 2018-05-24:
W.r.t. parallel thread execution: PyPy suffers from GIL (like e.g. CPython does) and the GIL-free pypy-stm is highly experimental.

Comment by thinwybk on 2018-05-26:
Just for completion: Multiprocessing allows parallel execution until the number of processors is reached. Has in comparison to multithreading some advantages/disadvantages.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.