ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Will ROS2 support PyPy?

asked 2018-05-23 04:23:57 -0600

thinwybk gravatar image

updated 2018-05-26 04:47:34 -0600

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-05-23 04:46:56 -0600

William gravatar image

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.

edit flag offensive delete link more


What's your estimated effort for rclpy only? :)

thinwybk gravatar image thinwybk  ( 2018-05-23 07:44:54 -0600 )edit

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.

William gravatar image William  ( 2018-05-23 16:22:06 -0600 )edit

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

thinwybk gravatar image thinwybk  ( 2018-05-24 01:43:55 -0600 )edit

Just for completion: Multiprocessing allows parallel execution until the number of processors is reached. Has in comparison to multithreading some advantages/disadvantages.

thinwybk gravatar image thinwybk  ( 2018-05-26 04:47:20 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-05-23 04:23:57 -0600

Seen: 350 times

Last updated: May 26 '18