Closed odel4y closed 1 year ago
No plans to support it, but always happy about PRs. I guess one could do a low-level pickle approach by implementing this at least for LaneletMap
objects and internally use lanelet2_io
s binary serialization backend and return the result to pickle as a bytestring. More than that would be messy and work-intensive because pickle would have to follow all references (members of lanelets, regulatory elements referenced by lanelets, lanelets referenced by these these regulatory elements, ...).
Since Lanelet2 doesn't use the interpreter, lanelet2 objects are not affected by the GIL. But making use this would require us to release the lock on every python api call, or at least on heavy tasks. And that wouldn't help for modules like multiprocessing
.
This issue is stale because it has been open for 90 days with no activity. Is this issue still work in progress? If yes, mark it as "WIP" or comment, otherwise it will be closed in 30 days.
This issue was closed because it has been stalled for 30 days with no activity.
Hi!
IMO many use-cases for Lanelet2 in Python would greatly benefit in performance from using multiple CPU cores. Python offers, amongst others, the multiprocessing module for this task to work around the Python GIL. A requirement to share Python objects between multiple processes is for them to support the Pickle serialization protocol. As Lanelet2's Python interface is built on interfacing its C++ class definitions, this support is currently not included. Boost.Python however offers methods to implement Pickle support explicitly.
Do you have any plans to support Pickle serialization or have had thoughts about that topic in the past? I can currently not quite grasp the workload that an implementation for the Basic Lanelet2 classes would require.
Thanks!