Skip to content

Inline Limits::free - #3093

Closed
fyrsta7 wants to merge 1 commit into
image-rs:mainfrom
fyrsta7:perf/inline-limits-free
Closed

Inline Limits::free#3093
fyrsta7 wants to merge 1 commit into
image-rs:mainfrom
fyrsta7:perf/inline-limits-free

Conversation

@fyrsta7

@fyrsta7 fyrsta7 commented Aug 2, 2026

Copy link
Copy Markdown

Summary

This adds #[inline] to Limits::free.

Why this can improve performance

Limits::free is a tiny helper that forwards released allocation budget back into max_alloc. Inlining lets callers avoid a function call around the small Option check and saturating add.

Validation

  • git diff --check
  • cargo check --manifest-path Cargo.toml --lib

Benchmark

Draft note: I do not have a fresh public API benchmark that isolates this internal decoder limit helper. The change is intentionally small and submitted as a draft for maintainer feedback.

@197g 197g closed this Aug 2, 2026
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