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

Various performance optimizations #262

Open
wants to merge 5 commits into
base: humble
Choose a base branch
from
Open

Conversation

DanBmh
Copy link

@DanBmh DanBmh commented Jan 29, 2025

Reduced the image grabbing/processing time by about 30% for my a2A1920-160umBAS.
Instead of 18ms per frame it now only takes 12ms per frame.

Influence of changes:

  • drop camera reconnecting and just fail (-1ms)
  • ignore encoding changes on runtime (-0.25ms)
  • default disabled status/params publishers (-4ms)
  • optimized bit shift and chunking at grab (-0.5ms and -0.5ms)

The main reason for the time improvements is that the api calls in those code snippets take a lot of time.
There should be further optimization options in other methods as well. Basically the best option might be a complete reimplementation of the parameter handling which stores/updates them as class attributes each time they are changed, so that they don't need to be requested every time.

@FrancoisPicardDTI
Copy link
Collaborator

Hello @DanBmh
Thank you for your contributions! I can understand why you did that but what annoys me is that with your version, it is not possible for the user to change the chunk mode and the encoding at runtime, and it does not allow to reconnect the camera anymore if it is disconnected. I was not the philosophy followed when the driver has been developed in the first place. I need to think about how to make it more flexible, maybe through services. I am keeping the PR opened for now.

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

Successfully merging this pull request may close these issues.

2 participants