SearchFilesByContent: improving memory efficiency
This iterator-based approach just keeps a small window of up to 3 lines in RAM, instead of the full list previously obtained with splitlines()`). It uses `collections.deque` (natively implemented), to make sure the window will never be reallocated. On the other hand, matching lines are allocated afresh, which is expected not to be a problem. At this point, further improvements should take the form of an implementation in RHGitaly.
Showing
- hgitaly/service/repository.py 72 additions, 28 deletionshgitaly/service/repository.py
- hgitaly/service/tests/test_repository_service.py 12 additions, 6 deletionshgitaly/service/tests/test_repository_service.py
- tests_with_gitaly/test_repository_service.py 5 additions, 1 deletiontests_with_gitaly/test_repository_service.py
Loading
Please register or sign in to comment