Repository navigation
feat: Cache internal string 3x speedup - #265
Conversation
|
Pulls: #265 |
|
I retested this with a ping pong test of visualization markers. With this patches I get 60 msg/sec at 20% cpu load |
|
Tick the box to add this pull request to the merge queue (same as
|
Signed-off-by: Janosch Machowinski <[email protected]>
f371a40 to
62cad7c
Compare
|
Pulls: #265 |
62cad7c to
3853c2c
Compare
``convert_to_py`` now allocates the Python message directly and writes to the ``_field`` slots instead of calling the class and assigning through the property setters. ``__init__`` used to recursively construct a default value for every field, all of which were immediately overwritten. ``convert_from_py`` reads the slots directly for the same reason. On a ``visualization_msgs/MarkerArray`` with 500 markers holding 200 nested elements each, ``convert_to_py`` went from 110 ms to 30 ms and ``convert_from_py`` from 22 ms to 9 ms. Behavior change: because the property setters are bypassed, ``ROS_PYTHON_CHECK_FIELDS=1`` no longer runs its type assertions when a message is converted from C to Python. It still applies to messages that user code constructs or assigns to. The values produced by the conversion are built by the generated C code itself and cannot have the wrong type. Assisted-by: Claude Opus 5 Signed-off-by: Janosch Machowinski <[email protected]>
Signed-off-by: Janosch Machowinski <[email protected]>
Signed-off-by: Janosch Machowinski <[email protected]>
3853c2c to
3f6f24a
Compare
|
Pulls: #265 |
Signed-off-by: Janosch Machowinski <[email protected]>
|
Pulls: #265 |
Description
AI experiment to speed up serialization.
Fixes # (issue)
Is this user-facing behavior change?
No
Did you use Generative AI?
Yes, claude sonet
Additional Information
Draft for now