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 imagethinwybk ( 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 imageWilliam ( 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 imagethinwybk ( 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 imagethinwybk ( 2018-05-26 04:47:20 -0500 )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

2 followers

Stats

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

Seen: 104 times

Last updated: May 26 '18