Skip to content

Box up DWARF units#1589

Merged
d-e-s-o merged 1 commit into
libbpf:mainfrom
d-e-s-o:topic/boxed-units
Jun 10, 2026
Merged

Box up DWARF units#1589
d-e-s-o merged 1 commit into
libbpf:mainfrom
d-e-s-o:topic/boxed-units

Conversation

@d-e-s-o

@d-e-s-o d-e-s-o commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

gimli::Unit is a sizeable type and our Units abstractions effectively stores an array of those. When many units are present (our vmlinux image has ~2200), this can lead to unnecessary high memory usage (the object may never actually be populated if it isn't involved in symbolization) and memcpy overhead when copied around.
Heap allocate objects of this type in two locations to mitigate these problems and speed things up some more.

Closes: #1578
Suggested-by: Jannik Glückert jannik.glueckert@gmail.com

gimli::Unit is a sizeable type and our Units abstractions effectively
stores an array of those. When many units are present (our vmlinux image
has ~2200), this can lead to unnecessary high memory usage (the object
may never actually be populated if it isn't involved in symbolization)
and memcpy overhead when copied around.
Heap allocate objects of this type in two locations to mitigate these
problems and speed things up some more.

Closes: libbpf#1578
Suggested-by: Jannik Glückert <jannik.glueckert@gmail.com>
Signed-off-by: Daniel Müller <deso@posteo.net>
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.29%. Comparing base (13f5dcc) to head (304187c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1589      +/-   ##
==========================================
- Coverage   96.31%   96.29%   -0.03%     
==========================================
  Files          56       56              
  Lines       11134    11135       +1     
==========================================
- Hits        10724    10722       -2     
- Misses        410      413       +3     

☔ 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.

@d-e-s-o d-e-s-o force-pushed the topic/boxed-units branch from 30be091 to 304187c Compare June 10, 2026 21:18
@d-e-s-o d-e-s-o merged commit 85e1c63 into libbpf:main Jun 10, 2026
46 checks passed
@d-e-s-o d-e-s-o deleted the topic/boxed-units branch June 10, 2026 21:24
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.

DWARF Units parsing is inefficient

1 participant