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

optimize rs2_get_options_list with bulk operation #13613

Merged
merged 3 commits into from
Dec 18, 2024

Conversation

maloel
Copy link
Collaborator

@maloel maloel commented Dec 17, 2024

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
Copy link
Contributor

@remibettan remibettan left a comment

Choose a reason for hiding this comment

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

Great PR! Well done.

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
Collaborator

Choose a reason for hiding this comment

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

RAII?

Copy link
Collaborator 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 IntelRealSense:development Dec 18, 2024
22 of 23 checks passed
@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