Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance of finding indexables #2082

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Commits on Sep 25, 2024

  1. Improve performance of finding indexables

    Currently, all folders and files in the current tree are turned into
    IndexablePath, and then excluded files are filtered out after.
    
    When there are large file trees that are meant to be excluded, this
    results in a lot of unnecessary work.
    
    ActiveStorage stores files in the `tmp` directory in many many small
    folders. So does Bootsnap. Additionally, node_modules can become quite
    large. Ruby LSP has to traverse all of these files,
    even though the entire directory should just be ignored.
    
    Instead we can skip any top-level directories whose paths have been
    excluded.
    
    We still need to loop through all IndexablePath objects compare them to the
    exclude_patterns, in case nested folders or file name patterns were excluded.
    Still, skipping some large top-level directories proves to be a big
    performance improvement.
    
    Before this PR in my Rails app, `indexables` took 76 seconds to run. Now
    it takes, 0.17 seconds. Before and after code both return the same exact
    file list.
    natematykiewicz committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    39ca825 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2024

  1. Configuration menu
    Copy the full SHA
    c16b362 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    249167b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    050ee96 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    14495ad View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1bf7699 View commit details
    Browse the repository at this point in the history