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

Have Svc/CmdDispatcher use hash to store/lookup opcodes #2969

Open
timcanham opened this issue Oct 19, 2024 · 0 comments
Open

Have Svc/CmdDispatcher use hash to store/lookup opcodes #2969

timcanham opened this issue Oct 19, 2024 · 0 comments

Comments

@timcanham
Copy link
Collaborator

F´ Version v3.5.0
Affected Component /Svc/CmdDispatcher

Feature Description

Have CmdDispatcher use a hash table to store command opcode registrations and to look up opcodes for dispatching.

Rationale

The current implementation uses a linear search to find a registration slot:

https://github.com/nasa/fprime/blob/devel/Svc/CmdDispatcher/CommandDispatcherImpl.cpp#L30

Likewise, when an opcode is received, the same linear search is made to dispatch it:

https://github.com/nasa/fprime/blob/devel/Svc/CmdDispatcher/CommandDispatcherImpl.cpp#L30

This approach won't scale well for large numbers of commands, so a hash table (like the one on Svc/TlmChan would make the lookups faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant