Skip to content

perf: use StackVec in render channel plumbing#710

Open
hjanuschka wants to merge 1 commit intolibjxl:mainfrom
hjanuschka:perf/pr04-stackvec-render-plumbing
Open

perf: use StackVec in render channel plumbing#710
hjanuschka wants to merge 1 commit intolibjxl:mainfrom
hjanuschka:perf/pr04-stackvec-render-plumbing

Conversation

@hjanuschka
Copy link
Copy Markdown
Collaborator

This introduces a fixed-capacity StackVec and uses it in render channel/row hot paths instead of SmallVec. It removes stack-vs-heap branch overhead in frequently executed indexing and row collection paths while keeping behavior unchanged. Unsafe in StackVec is only for MaybeUninit element access and is safe because reads are restricted to initialized elements in 0..len and writes respect capacity invariants.

@github-actions
Copy link
Copy Markdown

Benchmark @ 38d6610

MULTI-FILE BENCHMARK RESULTS (4 files)
  CPU architecture: x86_64
  WARNING: System appears noisy: high system load (2.37). Results may be unreliable.
Statistics:
  Confidence:               99.0%
  Max relative error:        3.0%

Comparing: e883140e (Base) vs c31adff2 (PR)

File Base (MP/s) PR (MP/s) Δ%
bike.jxl 24.478 24.922 +1.82% ±2.9%
green_queen_modular_e3.jxl 7.910 7.805 -1.33% ±1.2%
green_queen_vardct_e3.jxl 24.044 24.188 +0.60% ±0.7%
sunset_logo.jxl 2.784 2.767 -0.63% ±0.4%

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