-
Notifications
You must be signed in to change notification settings - Fork 28
perf: improve memory consumption in 2ms file walk #287
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
perf: improve memory consumption in 2ms file walk #287
Conversation
|
Great job, no security vulnerabilities found in this Pull Request |
cx-rogerio-dalot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should have a package under engine, something like engine/semaphore. We can have all the logic there that handles everything related to the weights and memory (including the one in cmd/memory).
In cmd we can then handle the DI of the semaphore by injecting it on the engine instance. It is in the end, the semaphore that knows which memory budget to allocate and how to handle the weights, and the engine, that should operate and depend on the semaphore.
WDYT?
It makes perfect sense, it is a cleaner and more modular approach. |
afc7d7d to
b3d896e
Compare
|
Awesome work 🎉 |
…memory-consumption-in-2-ms-file-walk
**Proposed Changes** - Separate secret detection logic for filesystem plugin - Chunking when the processed file is larger than 10 MB (with peeking so as not to lose the context of the secrets); - Weighted semaphore to control the use of memory (with a dynamic budget, i.e., dependent on the host's RAM). **Checklist** - [x] I covered my changes with tests. - [ ] I Updated the documentation that is affected by my changes: - [ ] Change in the CLI arguments - [ ] Change in the configuration file --------- Co-authored-by: cx-leonardo-fontes <[email protected]>








Proposed Changes
Checklist