-
Notifications
You must be signed in to change notification settings - Fork 7
Description
In mqtt you can subscribe to array of topics in one request.
This can speed up the initial subscription phase when you need to subscribe to 5 or 10 or 100 topics in one request instead of running them separately.
I run some quick benchmarks and on my computer to subscribe to 2k topics with x6 CPU throttling takes:
1 500ms for zenoh-ts
300ms for mqtt ( batched )
This can be huge difference for embedded hardware with low cpu capabilities that run web applications.
You probably could add new method that has to have "key expressions" and "handlers"?
const handler = (sample) => console.log(sample)
declare_subscribers( [ { "key_expr1", handler }, { "key_expr2", handler } ] )
Or batch them behind the scenes yourselves without exposing new method like mqtt does by default for up to 3 subscriptions.