Skip to content

Don't clone params on benchmark hotpath#1253

Merged
ludfjig merged 1 commit into
hyperlight-dev:mainfrom
ludfjig:bench_improve_hotpath
Feb 26, 2026
Merged

Don't clone params on benchmark hotpath#1253
ludfjig merged 1 commit into
hyperlight-dev:mainfrom
ludfjig:bench_improve_hotpath

Conversation

@ludfjig

@ludfjig ludfjig commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Move the 50MB Vec and String clones out of the measured benchmark region for the large parameters benchmark by using iter_with_setup. Also replace unsafe from_utf8_unchecked with safe from_utf8 since this is setup code, not performance-critical.

This was bothering me when profiling #1241

@ludfjig ludfjig added the kind/enhancement For PRs adding features, improving functionality, docs, tests, etc. label Feb 24, 2026
@ludfjig ludfjig marked this pull request as ready for review February 24, 2026 16:43
dblnz
dblnz previously approved these changes Feb 25, 2026

@dblnz dblnz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
@ludfjig ludfjig force-pushed the bench_improve_hotpath branch from 4e51e3b to da4c9ca Compare February 25, 2026 19:08
@ludfjig ludfjig merged commit afd325e into hyperlight-dev:main Feb 26, 2026
108 of 110 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement For PRs adding features, improving functionality, docs, tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants