Skip to content

optimize rs2_get_options_list with bulk operation - #13613

Merged
maloel merged 3 commits into
realsenseai:developmentfrom
maloel:bulk
Dec 18, 2024
Merged

optimize rs2_get_options_list with bulk operation#13613
maloel merged 3 commits into
realsenseai:developmentfrom
maloel:bulk

Conversation

@maloel

@maloel maloel commented Dec 17, 2024

Copy link
Copy Markdown
Contributor

Before, a simple average rs2_get_options_list() on a D455 was ~350ms.
Now it's ~24.

Moved the prepare_bulk_operation() and finish_bulk_operation() functions into sensor_base so they can also be used on synthetic_sensor and forwarded to the raw sensor.

The actual rs2_get_options_list function now prepares and finishes the bulk-operation before/after doing its thing.

@maloel
maloel requested a review from remibettan December 17, 2024 18:42

@remibettan remibettan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR! Well done.

Comment thread src/sensor.h Outdated
// type we might want to change power state or encapsulate small transactions into a large one.
virtual void prepare_for_bulk_operation() {}
virtual void finished_bulk_operation() {}
// And ROII, too:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RAII?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right :) WIll fix, or just remove the line...

@maloel
maloel merged commit 37028f7 into realsenseai:development Dec 18, 2024
@maloel
maloel deleted the bulk branch December 18, 2024 15:42
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.

3 participants