Skip to content

ls: Remove potentially redundant syscall, only use direntries for file types#11423

Open
kimono-koans wants to merge 16 commits intouutils:mainfrom
kimono-koans:Redundant-statx-syscalls
Open

ls: Remove potentially redundant syscall, only use direntries for file types#11423
kimono-koans wants to merge 16 commits intouutils:mainfrom
kimono-koans:Redundant-statx-syscalls

Conversation

@kimono-koans
Copy link
Contributor

@kimono-koans kimono-koans commented Mar 19, 2026

Here, we were requesting symlink_metadata before proceeding to the color_name fn, and I've also completely eliminated the need to hold onto DirEntrys within the PathData struct. Statx calls are faster.

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 19, 2026

Merging this PR will degrade performance by 20.22%

⚡ 7 improved benchmarks
❌ 4 regressed benchmarks
✅ 287 untouched benchmarks
⏩ 48 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory ls_recursive_wide_tree[(10000, 1000)] 6.6 MB 5.8 MB +14.06%
Memory ls_recursive_long_all_wide_tree[(15000, 1500)] 9.9 MB 8.7 MB +14.17%
Memory ls_recursive_mixed_tree 133.1 KB 163 KB -18.37%
Memory ls_recursive_long_all_deep_tree[(100, 4)] 126 KB 158 KB -20.22%
Memory ls_recursive_deep_tree[(200, 2)] 143.2 KB 175.1 KB -18.21%
Memory ls_recursive_long_all_mixed_tree 132.4 KB 164 KB -19.25%
Simulation ls_recursive_mixed_tree 1.4 ms 1.3 ms +5.64%
Simulation ls_recursive_wide_tree[(10000, 1000)] 53.9 ms 46.5 ms +15.88%
Simulation ls_recursive_deep_tree[(200, 2)] 1.7 ms 1.6 ms +5.39%
Simulation ls_recursive_balanced_tree[(6, 4, 15)] 56.9 ms 50.3 ms +13.05%
Simulation ls_recursive_long_all_wide_tree[(15000, 1500)] 136 ms 121.4 ms +12%

Comparing kimono-koans:Redundant-statx-syscalls (b526069) with main (c79e686)

Open in CodSpeed

Footnotes

  1. 48 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@kimono-koans kimono-koans changed the title ls: Remove potentially redundant statx call ls: Remove potentially redundant syscall, only use direntries for file types Mar 20, 2026
@oech3

This comment was marked as resolved.

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