Skip to content

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

Merged
olafurpg merged 2 commits into
mainfrom
olafurpg/stalled-progress
Jul 11, 2023
Merged

Skip indexing large files above 1mb, add option --max-file-byte-size#271
olafurpg merged 2 commits into
mainfrom
olafurpg/stalled-progress

Conversation

@olafurpg

Copy link
Copy Markdown
Contributor

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 requested a review from valerybugakov July 11, 2023 09:02
@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
Comment thread src/FileIndexer.ts Outdated
@olafurpg
olafurpg merged commit d56d117 into main Jul 11, 2023
@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