Skip to content

Is there a plan for batched subscriptions? #125

@faridsaid20

Description

@faridsaid20

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions