Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bad deserialize perfomance with image data array #117

Open
panshengjie opened this issue Oct 22, 2018 · 4 comments
Open

bad deserialize perfomance with image data array #117

panshengjie opened this issue Oct 22, 2018 · 4 comments

Comments

@panshengjie
Copy link
Contributor

I've check the source code, In

deserializeInnerMessage (message.js)

reading buildin-type array one-by-one using buffer.readUInt8 ,eating-up the CPU.

@chris-smith
Copy link
Collaborator

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.

@chfritz
Copy link
Contributor

chfritz commented Nov 12, 2018

@panshengjie thanks for reporting. Do you have a canonical code example to reproduce this? That would help us fix this more promptly.

@panshengjie
Copy link
Contributor Author

@chfritz I was subscirbed to a image topic, with type sensor_msgs/Image, and found a significant rise on cpu usage

@panshengjie
Copy link
Contributor Author

for uint8 array, I've forced converting buffer to Uint8Array . BUT this is not a general resolution, may lead to compatibility issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants