Unclear what the difference between Publisher and Put is
Describe the bug
I am reporting this because it doesn’t seem to be documented anywhere. Are there any performance benefits or any optimizations involved when I declare a Publisher and send data through that instead of just using Put without declaring anything?
To reproduce
N/A
System info
Zenoh 1.0.0-beta.1
Hi @hassomehide,
Publisher does indeed an optimizations, so it can be used when publishing the same key expression multiple times, while the put is more to one-shot or sporadic publications on a certain key-expression.
@gabrik thanks for the response. Are these optimizations related to just reusing the key expression or is there more? To put it in another way, is there any difference between sending data through a Publisher vs declaring a reusable KeyExpr and using the Put operation without any Publisher?
The number of optimizations depends on the configuration of the publisher, it can include the declaration of liveliness tokens, configuration of congestion control, etc.
Some of those can also be configured for a put.
The number and extension of optimizations are implementation dependent and may vary at any point in time.
The rule to retain and follow is:
- Use
session.putfor one-off publication on a specific key expression - Use
session.declare_publisherfor any periodic/long-lived publication
@hassomehide if you don't have any additional comment I suggest to close this issue as complete.