Skip to content

Allocate all FU-A fragments of a NALU at once - #383

Open
g4lb wants to merge 1 commit into
pion:mainfrom
g4lb:h264-fua-one-buffer
Open

g4lb wants to merge 1 commit into
pion:mainfrom
g4lb:h264-fua-one-buffer

Conversation

@g4lb

@g4lb g4lb commented Nov 27, 2026

Copy link
Copy Markdown

H264Payloader allocated one buffer for each FU-A fragment. Now it allocates one buffer for all fragments of a NALU, and each payload is a capped slice of it. The payloads do not change.

Frame Time Bytes Allocs
5 KB 1071 → 790 ns (−26%) 5.57 → 5.38 KiB 9 → 2
30 KB 5.77 → 4.31 µs (−25%) 32.9 → 32.6 KiB 32 → 2
200 KB 36.0 → 25.2 µs (−30%) 216 → 204 KiB 175 → 2

A 500 B frame (no FU-A) did not change. No benchmark was slower in all 3 code layouts (AMD EPYC 9V74, Go 1.27.4). Old and new payloads matched on 400,000 random frames.

@codecov

codecov Bot commented Nov 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.16%. Comparing base (9a8f935) to head (7125537).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #383      +/-   ##
==========================================
+ Coverage   88.15%   88.16%   +0.01%     
==========================================
  Files          28       28              
  Lines        3173     3178       +5     
==========================================
+ Hits         2797     2802       +5     
  Misses        376      376              
Flag Coverage Δ
go 88.16% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JoTurk JoTurk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you

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