Add benchmark harness and disable ORT thread pool spinning#785
Draft
xav-ie wants to merge 2 commits intoroyshil:mainfrom
Draft
Add benchmark harness and disable ORT thread pool spinning#785xav-ie wants to merge 2 commits intoroyshil:mainfrom
xav-ie wants to merge 2 commits intoroyshil:mainfrom
Conversation
2eae688 to
e46c6d0
Compare
Author
|
I am happy to split this into two. The second commit really helped my computer a lot. |
Collaborator
|
Can you add a file to describe how we can compile and run the benchmark program? |
Collaborator
|
Thanks for signing the commits. We think supply chain security is important. |
Collaborator
|
I will add CONTRIBUTING.md for clarity of licensing before we merge your pull requests. Please wait for my work, I will start immediately. CONTRIBUTING.md was temporarily removed due to reorganizing this project. Thanks in advance. |
umireon
previously requested changes
Feb 27, 2026
Collaborator
umireon
left a comment
There was a problem hiding this comment.
Working on the CONTRIBUTING.md now. Sorry but wait a moment, please.
Collaborator
|
@xav-ie I've added checklist to your description. Feel free to ask us for question, it is added to this project just now. |
Extract shared pipeline helper functions (render_write, tick_read, check_similarity, preprocess_for_inference) into src/pipeline-helpers.h for use by both the plugin and a standalone benchmark. The benchmark exercises the same code paths as the plugin: 1. Render thread writes frame to shared buffer (clone) 2. Tick thread reads frame from shared buffer (clone) 3. Similarity check via full-frame PSNR 4. Preprocessing: cvtColor(BGRA→RGB) then resize Reports per-frame timing (mean/median/p95), hardware perf counters (cache-misses, LLC-store-misses via perf_event_open), and optionally measures CPU utilization with a real ONNX Runtime thread pool at 30fps. Signed-off-by: Xavier Ruiz <github@xav.ie>
Set session.intra_op.allow_spinning=0 and session.inter_op.allow_spinning=0 to prevent ORT worker threads from busy-waiting between inference calls. This eliminates idle CPU burn without affecting inference latency. Signed-off-by: Xavier Ruiz <github@xav.ie>
e46c6d0 to
68d9c8c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
benchmark/) with extracted pipeline helpers that exercise the preprocessing and similarity-check hot path using synthetic 1920×1080 BGRA frames and Linuxperf_event_openhardware countersallow_spinning = 0) to reduce idle CPU usage when the session is waiting for framesBenchmark results (300 iterations, best of 3 runs)
Pull Request Checklist
Please read our latest CONTRIBUTING.md.