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

Skip indexing large files above 1mb, add option --max-file-byte-size #271

Merged
merged 2 commits into from
Jul 11, 2023

Conversation

olafurpg
Copy link
Member

Previously, scip-typescript indexed all files regardless of file size. This could result in scip-typescript stalling progress to index very large files that were (frequently) auto-generated. This commit changes the default behavior to skip indexing files that are larger than 1mb, and makes this threshold configurable via the new --max-file-byte-size flag.

Test plan

  • New unit tests for the parse function
  • Manually tested in the sourcegraph/sourcegraph repo with the command ❯ ts-node ~/dev/sourcegraph/scip-typescript/src/main.ts index --pnpm-workspaces --max-file-byte-size 500kb. Printed out skipped files and confirmed they all exceeded 500kb.

Previously, scip-typescript indexed all files regardless of file size.
This could result in scip-typescript stalling progress to index very
large files that were (frequently) auto-generated. This commit changes
the default behavior to skip indexing files that are larger than 1mb,
and makes this threshold configurable via the new `--max-file-byte-size`
flag.
@olafurpg olafurpg changed the title Add configurable option to skip large files Add configurable option `--max-file-byte-size- to skip large files Jul 11, 2023
@olafurpg olafurpg changed the title Add configurable option `--max-file-byte-size- to skip large files Skip indexing large files above 1mb, add option --max-file-byte-size Jul 11, 2023
src/FileIndexer.ts Outdated Show resolved Hide resolved
@olafurpg olafurpg merged commit d56d117 into main Jul 11, 2023
6 checks passed
@olafurpg olafurpg deleted the olafurpg/stalled-progress branch July 11, 2023 09:33
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