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

feat: support --exclude-content #509

Closed
wants to merge 1 commit into from

Conversation

apocelipes
Copy link
Contributor

@apocelipes apocelipes commented Sep 11, 2024

Fixes #507.

Support the "--exclude-content" option.

The reason why I put file content filtering in scc instead of gocodewalker is that we need to read the file contents first, and scc already did it, so only a small amount of code needs to be modified to implement the "exclude-content". And I put the filter in fileProcessorWorker() because that makes it run in different goroutines in parallel.

When we set "--exclude-content", the performance could get about 20% downgrade because we need to check files contents line by line:

benchmark

There's no performance impact when not adding the "--exclude-content" option.

@apocelipes apocelipes marked this pull request as draft September 12, 2024 03:03
@apocelipes
Copy link
Contributor Author

This PR is no more needed since 507 has been resolved.

@apocelipes apocelipes closed this Sep 12, 2024
@apocelipes apocelipes deleted the feat-507 branch September 12, 2024 23:34
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.

Feature request:
1 participant