Skip to content

perf: avoid recursive dir-size calculation in non-size views#154

Open
Maanas-Verma wants to merge 1 commit intochaqchase:mainfrom
Maanas-Verma:codex/issue-152-grid-performance
Open

perf: avoid recursive dir-size calculation in non-size views#154
Maanas-Verma wants to merge 1 commit intochaqchase:mainfrom
Maanas-Verma:codex/issue-152-grid-performance

Conversation

@Maanas-Verma
Copy link
Copy Markdown

@Maanas-Verma Maanas-Verma commented Mar 12, 2026

Summary

  • Fix performance issue from slow on big directories ( macos ) #152 where lla -g is slow in large parent directories when include_dirs=true.
  • Avoid recursive directory size aggregation in views that do not consume size metadata (grid/default/tree/timeline/git/recursive human output).
  • Preserve recursive directory sizing for size-aware paths: long/table/sizemap/fuzzy, sort-by-size, size filters, and machine-readable outputs.
  • Clarify include-dirs and config docs as recursive and potentially expensive.

Root Cause

When include_dirs=true, list_and_decorate_files computed recursive size for every directory entry unconditionally. In large directory trees, this dominated runtime/system time even for grid output where size is not rendered.

Validation

  • cargo fmt
  • cargo test -p lla
  • Manual benchmark comparison:
    • Grid view remains fast with include_dirs=true.
    • Long view with include-dirs remains expensive as expected for size-aware output.

Attribution

This change was implemented via Codex.

@Maanas-Verma
Copy link
Copy Markdown
Author

@chaqchase, I have tested it out and it's works fine. Can you please test and merge it from your end.

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