rosnodejs
rosnodejs copied to clipboard
bad deserialize perfomance with image data array
I've check the source code, In
deserializeInnerMessage (message.js)
reading buildin-type array one-by-one using buffer.readUInt8 ,eating-up the CPU.
I believe you've stumbled on a case where we didn't update the on-the-fly message code to work the same way as the pre-generated messages. The generated messages specifically deal with uint8 arrays by slicing out a section of the overall message buffer rather than iterating over the length of the array.
@panshengjie thanks for reporting. Do you have a canonical code example to reproduce this? That would help us fix this more promptly.
@chfritz I was subscirbed to a image topic, with type sensor_msgs/Image, and found a significant rise on cpu usage
for uint8 array, I've forced converting buffer to Uint8Array . BUT this is not a general resolution, may lead to compatibility issues