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

Add benchmarks #9

Open
baptiste0928 opened this issue Feb 16, 2022 · 5 comments
Open

Add benchmarks #9

baptiste0928 opened this issue Feb 16, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@baptiste0928
Copy link
Contributor

I think it might be interesting to add benchmarks to get an idea of remoc performance and avoid regressions. This could be done with criterion since it supports async benchmarks.

Benchmarks could also be made to compare remoc to other similar libs like tarpc and with a raw TCP socket (to get an idea of the performance overhead introduced by remoc).

@surban
Copy link
Member

surban commented Feb 24, 2022

This would indeed be interesting.

However, we would need a more elaborate simulation of TCP that takes the latency between two endpoints into account. This is necessary since chmux uses credits-based flow control, which may be negatively affected by the connection latency if the receive buffer is chosen too small for the connection speed.

@dragonnn
Copy link

dragonnn commented Jun 9, 2022

However, we would need a more elaborate simulation of TCP that takes the latency between two endpoints into account. This is necessary since chmux uses credits-based flow control, which may be negatively affected by the connection latency if the receive buffer is chosen too small for the connection speed.

Do you have any comment/opinion about using remoc over Unix Sockets? I can confirm that it works but didn't do any comparison against tcp when it comes to performance

@surban
Copy link
Member

surban commented Jun 9, 2022

Do you have any comment/opinion about using remoc over Unix Sockets? I can confirm that it works but didn't do any comparison against tcp when it comes to performance

It should work just fine when you use Connect::io_buffered. This will minimize system calls by buffering packets internally and performing one system call to send the buffered data when the buffer is full (or no more data is available for sending).

@dragonnn
Copy link

dragonnn commented Jun 9, 2022

Some recommendations for the buffer size? And as far I understand, for regular tcp port io_buffered is not recommend due network having the own buffers already?

@surban
Copy link
Member

surban commented Jun 9, 2022

Some recommendations for the buffer size?

I would choose the same size as the socket send buffer (readable from /proc/sys/net/core/wmem_max and is about 200 KB on my system).

And as far I understand, for regular tcp port io_buffered is not recommend due network having the own buffers already?

The kernel is buffering TCP data before sending it over the network, however without user space buffering you may have a high overhead of system calls. Thus I am also using Connect::io_buffered for TCP and have observed no negative effects so far. I am using a buffer size of 64 KB and have no trouble streaming JPEG live images from a camera connected to a RPi 4 using a rch::watch channel at 30 fps.

@surban surban added the enhancement New feature or request label Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants