Skip to content

Conversation

@harp-intel
Copy link
Contributor

This pull request focuses on modernizing string construction throughout the codebase by replacing string concatenation with the more efficient strings.Builder and by using fmt.Fprintf instead of fmt.Sprintf for building strings. These changes improve performance and code clarity, especially in sections that generate large or complex strings such as reports, scripts, and table renderers. Additionally, a minor update was made to the Makefile to adjust the check target dependencies.

String construction modernization:

  • Replaced string concatenation with strings.Builder and used fmt.Fprintf instead of fmt.Sprintf for building strings in various locations, including table renderers, report generators, script builders, and telemetry functions. This affects files such as cmd/config/config_tables.go, cmd/config/restore.go, cmd/config/set.go, cmd/metrics/perf_mux.go, cmd/flame/flame_tables.go, cmd/telemetry/telemetry_tables.go, and multiple report rendering functions in internal/report/render_html.go and internal/report/render_text.go. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]

Build process update:

  • Removed the check_modernize dependency from the check target in the Makefile, streamlining the default check process.

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
@harp-intel harp-intel merged commit f58fe08 into main Dec 12, 2025
1 of 2 checks passed
@harp-intel harp-intel deleted the modernize branch December 12, 2025 17:53
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.

2 participants