Skip to content

Use unstable sort for by-address symbol index creation#1544

Closed
d-e-s-o wants to merge 1 commit intolibbpf:mainfrom
d-e-s-o:topic/elf-unstable
Closed

Use unstable sort for by-address symbol index creation#1544
d-e-s-o wants to merge 1 commit intolibbpf:mainfrom
d-e-s-o:topic/elf-unstable

Conversation

@d-e-s-o
Copy link
Copy Markdown
Collaborator

@d-e-s-o d-e-s-o commented Apr 17, 2026

Switch create_by_addr_idx() from sort_by() to sort_unstable_by(). The stable sort allocates a temporary buffer equal in size to the input for its merge phase. The unstable variant sorts in-place instead. Stability is not required here because the secondary sort key (size descending) already fully determines the order among equal-address symbols.
Apply the same change to create_str2sym()'s sort_by_key() call.

Switch create_by_addr_idx() from sort_by() to sort_unstable_by().
The stable sort allocates a temporary buffer equal in size to the input
for its merge phase. The unstable variant sorts in-place instead.
Stability is not required here because the secondary sort key (size
descending) already fully determines the order among equal-address
symbols.
Apply the same change to create_str2sym()'s sort_by_key() call.

Signed-off-by: Daniel Müller <deso@posteo.net>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 17, 2026

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1544      +/-   ##
==========================================
- Coverage   95.51%   95.47%   -0.04%     
==========================================
  Files          56       56              
  Lines        9534     9534              
==========================================
- Hits         9106     9103       -3     
- Misses        428      431       +3     

☔ View full report in Codecov by Sentry.
📢 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
Copy link
Copy Markdown
Collaborator Author

d-e-s-o commented Apr 17, 2026

Will combine this with another change.

@d-e-s-o d-e-s-o closed this Apr 17, 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.

1 participant