Skip to content

itt reference collector implementation has a huge overhead #184

@kuhanov

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions