Introduce an iter_log method to iterate through logs of a same file #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Responding to the previously created issue #14, here's a first proposition.
We had to test this on our own sysdiags since we do not have yours available, so it'll need more testing on your end, but we noticed an improvement in peak memory usage from ~970mb to ~600mb when parsing the logs.
There's still improvements to be made of course, we introduced an iterator on the surface but it could potentially be iterators all the way down, however the changes required would be substantial.
Here you'll notice that we moved most of the logic from build_log to a new LogIterator structure that itself is used by build_log.
We didn't address the fact that all data is first loaded as a UnifiedLogData, which in our opinion constitutes most of the remainder of the memory usage, since we don't know if that is even possible at that point.
Let me know what you think !