From cb25329c428ca3dc291ce4c4cb7f8991032e7056 Mon Sep 17 00:00:00 2001 From: Giovanni LB Date: Fri, 2 Jun 2023 17:29:45 -0300 Subject: [PATCH] File plugin performance improvement (upto 40%) by not using endl. Change-Id: Ic9be0fb144eb0fa95f8e72c2de46ee4187f071c3 [ROCm/rocprofiler commit: 58d82814e1c5f7562ac8e994043fb8992ce62fc9] --- projects/rocprofiler/plugin/file/file.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/projects/rocprofiler/plugin/file/file.cpp b/projects/rocprofiler/plugin/file/file.cpp index ef52dd3c46..d19b1afe10 100644 --- a/projects/rocprofiler/plugin/file/file.cpp +++ b/projects/rocprofiler/plugin/file/file.cpp @@ -296,7 +296,7 @@ class file_plugin_t { } if (tracer_record.domain != ACTIVITY_DOMAIN_ROCTX) *output_file << ", Correlation_ID(" << tracer_record.correlation_id.value << ")"; - *output_file << std::endl; + *output_file << '\n'; } void FlushProfilerRecord(const rocprofiler_record_profiler_t* profiler_record, @@ -355,7 +355,7 @@ class file_plugin_t { << std::to_string(profiler_record->timestamps.end.value) << ")"; // For Counters - *output_file << std::endl; + *output_file << '\n'; if (profiler_record->counters) { for (uint64_t i = 0; i < profiler_record->counters_count.value; i++) { if (profiler_record->counters[i].counter_handler.handle > 0) { @@ -369,8 +369,7 @@ class file_plugin_t { session_id, ROCPROFILER_COUNTER_NAME, profiler_record->counters[i].counter_handler, &name_c)); *output_file << ", " << name_c << " (" - << std::to_string(profiler_record->counters[i].value.value) << ")" - << std::endl; + << std::to_string(profiler_record->counters[i].value.value) << ")\n"; } } }