Skip to content

[service] Add latency profiling support for single#667

Merged
jaeyun-jung merged 2 commits intonnstreamer:mainfrom
anyj0527:latency-profiling-service-single
Dec 3, 2025
Merged

[service] Add latency profiling support for single#667
jaeyun-jung merged 2 commits intonnstreamer:mainfrom
anyj0527:latency-profiling-service-single

Conversation

@anyj0527
Copy link
Member

  • Let the ml service using single conf can set latency profiling option
    Example:
{  "single": { ... "profile": "true" } }
  • To make it compatible with pipeline way (... latency=1 ...), ... "latency" : "1" in the conf will do the same
  • Added "profile" and "latency" fields to those single service conf files in unittests

REF: nnstreamer/nnstreamer#4806

- Let the ml service using single conf can set latency profiling option
Example:
```json
{  "single": { ... "profile": "true" } }
```
- To make it compatible with pipeline way `(... latency=1 ...)`,
key of "latency" and value of "1" will do the same thing.

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
- Added "profile" and "latency" fields to those single service conf files

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
Copy link
Contributor

@songgot songgot left a comment

Choose a reason for hiding this comment

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

You used 'profile' to add new profiling options.
I think this is a good design, as the profile field could potentially include various performance metrics, such as execution time, memory usage, CPU utilization, and function call frequency for each function/module.
However, if you only need latency measurements for now, unifying it to 'latency' might be a good option.

ml_tensors_data_cb invoke_async_cb; /**< Callback function to be called when the sub-plugin generates an output asynchronously. This is only available when invoke_async is set to TRUE. */
void *invoke_async_pdata; /**< Private data to be passed to async callback. */
void *invoke_async_pdata; /**< Private data to be passed to async callback. */
int latency_mode; /**< 1 - log invoke latency, 0 (default) - do not log */
Copy link
Contributor

@songgot songgot Nov 27, 2025

Choose a reason for hiding this comment

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

What do you think of this?

/**< 1: Enable latency log, 0 (default): Disable log */

@jaeyun-jung jaeyun-jung merged commit 34062b8 into nnstreamer:main Dec 3, 2025
11 checks passed
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