ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Will ROS2 support PyPy?

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

thinwybk gravatar image

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

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
0

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

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

Comments

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

thinwybk gravatar image thinwybk  ( 2018-05-23 07:44:54 -0500 )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 -0500 )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 -0500 )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 -0500 )edit

Question Tools

2 followers

Stats

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

Seen: 431 times

Last updated: May 26 '18