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

Is it possible to receive message without deserialize? #175

Closed
lantica opened this issue Apr 15, 2021 · 4 comments
Closed

Is it possible to receive message without deserialize? #175

lantica opened this issue Apr 15, 2021 · 4 comments

Comments

@lantica
Copy link

lantica commented Apr 15, 2021

I'd like to subscribe to a topic to serve as health checking.
However, the message being published is quite large and it leads to a high usage of CPU during deserialization of message which the content of the message doesn't matter to me.

Is there any way to receive the message without deserialization?

@chris-smith
Copy link
Collaborator

You could hack your way around to it. This is where we attach the event listener that leads to deserialization. You could remove the listener we attach and add your own. There's one of these per publisher connection.

Though if you have access, I'd recommend just adding another topic you can subscribe to.

@lantica
Copy link
Author

lantica commented Apr 16, 2021

Thank you for the advice. I can add my on event listener on it now.

However, the cpu usage does not reduce even it does not deserialize the message.
Could you suggest some other possibilities causing the high cpu usage?
The message type of the topic I subscribing to is PointCloud2.

@chris-smith
Copy link
Collaborator

The only other thing I can think of is just from pulling the messages off the wire - that happens here. PointCloud messages are generally pretty big and we don't reuse buffers so it could cause a lot of memory allocation.

@chfritz
Copy link
Contributor

chfritz commented Apr 17, 2021

That issue seems to be recurring, and reusing buffers was also suggested here: #118 (comment). Seems like a good idea.

@lantica lantica closed this as completed May 14, 2021
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