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

Remove toLower call on decoded chunk #1254

Merged
merged 2 commits into from
Apr 14, 2023
Merged

Remove toLower call on decoded chunk #1254

merged 2 commits into from
Apr 14, 2023

Conversation

zricethezav
Copy link
Collaborator

Description

This PR removes a wasteful call to toLower on decoded data. The ahocorasick prefilter matches with case insensitivity: https://github.com/trufflesecurity/trufflehog/blob/rm-tolower-prefilter/pkg/engine/engine.go#L145.

"Testing"

648 results found in both

~/code/trufflesecurity/trufflehog (main) gtime ./trufflehog  git --no-update --no-verification  file://$PWD | grep Found | wc -l
^[[A🐷🔑🐷  TruffleHog. Unearth your secrets. 🐷🔑🐷

real 4.33s
user 17.80s
sys  1.83s
memory:96936KB
cpu 453%
     648
~/code/trufflesecurity/trufflehog (main) gtime ./trufflehog  git --no-update --no-verification  file://$PWD | grep Found | wc -l
~/code/trufflesecurity/trufflehog (main) git checkout rm-tolower-prefilter
Switched to branch 'rm-tolower-prefilter'
~/code/trufflesecurity/trufflehog (rm-tolower-prefilter) go build
~/code/trufflesecurity/trufflehog (rm-tolower-prefilter) gtime ./trufflehog  git --no-update --no-verification  file://$PWD | grep Found | wc -l
🐷🔑🐷  TruffleHog. Unearth your secrets. 🐷🔑🐷

real 4.30s
user 17.06s
sys  1.78s
memory:92876KB
cpu 437%
     648

@zricethezav zricethezav requested a review from a team as a code owner April 13, 2023 20:20
@zricethezav zricethezav merged commit 1c89e79 into main Apr 14, 2023
@zricethezav zricethezav deleted the rm-tolower-prefilter branch April 14, 2023 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants