Skip to content

perf: pass unmodified std::string parameters by const reference - #565

Open
KFilipek wants to merge 2 commits into
oneapi-src:masterfrom
KFilipek:ze-string-by-const-ref
Open

KFilipek wants to merge 2 commits into
oneapi-src:masterfrom
KFilipek:ze-string-by-const-ref

Conversation

@KFilipek

@KFilipek KFilipek commented Nov 20, 2026 •

Copy link
Copy Markdown

ze_lib::debug_trace_message() and the to_layout(), to_format_type(), to_flag() and to_image_type() parsers in zello_log.h take std::string by value but never modify it, so every call copies the string.

Take const std::string & instead. No behavior change; callers are unaffected.

Found by Coverity (UNNECESSARY_STRING_COPY).

ze_lib::debug_trace_message() and the zello_log.h to_*() parsers take
std::string by value but never modify it, copying on every call. Take
const std::string& instead.

Found by Coverity UNNECESSARY_STRING_COPY.

Signed-off-by: Krzysztof Filipek <krzysztof.filipek@intel.com>
@KFilipek
KFilipek force-pushed the ze-string-by-const-ref branch from 95e7d6d to 581673b Compare November 20, 2026 10:55
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Level Zero loader ABI check

last-release (v1.36.0): ✅ no ABI problems. Report

Creating compatibility report ...
Binary compatibility: 100%
Source compatibility: 100%
Total binary compatibility problems: 0, warnings: 0
Total source compatibility problems: 0, warnings: 0

master (master): ✅ no ABI problems. Report

Creating compatibility report ...
Binary compatibility: 100%
Source compatibility: 100%
Total binary compatibility problems: 0, warnings: 0
Total source compatibility problems: 0, warnings: 0

Workflow run

If an ABI change is intended, a reviewer with write access can accept it: leave an approval review on the PR head commit with the keyword abi-failure-approved in the review body. That re-runs the check.

Same change as the previous commit for loader::context_t, including
the mako template that generates ze_loader_internal.h.

Signed-off-by: Krzysztof Filipek <krzysztof.filipek@intel.com>

This branch has not been deployed

No deployments
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.

1 participant