perf: improve memory consumption in 2ms file walk#287
perf: improve memory consumption in 2ms file walk#287cx-rui-oliveira merged 23 commits intomasterfrom
Conversation
|
Great job, no security vulnerabilities found in this Pull Request |
cx-rogerio-dalot
left a comment
There was a problem hiding this comment.
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 <204389152+cx-leonardo-fontes@users.noreply.github.com>








Proposed Changes
Checklist