Skip to content

itt reference collector implementation has a huge overhead #184

Closed

Description

@kuhanov

In the current reference implementation, the trace file is opened and closed upon every event logging operation. This means that for each task handled, the process performs a file open, a write operation, and a file close.

void log_func_call(uint8_t log_level, const char* function_name, const char* message_format, ...)
{
        ...
        pLogFile = fopen(g_ref_collector_logger.file_name, "a");
        if (!pLogFile)
        {
            printf("ERROR: Cannot open file: %s\n", g_ref_collector_logger.file_name);
            return;
        }
        fprintf(pLogFile, "%s\n", log_buffer);
        fclose(pLogFile);
        ...
}

This approach creates significant overhead. A more efficient method would be to open the trace file a single time during the initialization phase and close it gracefully during finalization. This would improve performance by reducing redundant I/O operations.

BTW, looks like need to update reference collector inside vtune profiler releases.

Activity

  1. self-assigned this
    on Sep 5, 2025
  2. linked a pull request that will close this issueImprove reference collector performance #186on Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions