Replace Foundation scanner implementation
This PR fixes the issue #215.
The memory leak is not XCLogParser implementation related, but instead associated with the Scanner object while parsing considerable large files (tested with 243.3MB logs).
The initial attempt replaced Scanner with Substrings (please check commit history). Due to the poor runtime performance, mostly related with protocol witness calls to collection methods, we had to replace with a new Scanner component, implementing a subset of methods for our usages. This new implementation avoids invoking non performance String related methods.
Taking into account the above mentioned file, we were able to improve performance by around 80% compared to masters implementation
@aleksandergrzyb this seems to be a promising PR, would you be able to pick this up?
I've merged these changes locally and can see the performance improvements, but mostly the memory improvements 👌 Great work @jrcmramos-bumble!
@aleksandergrzyb I updated the branch with one of @AvdLee suggestions. Would it be possible to reapprove it please? Thank you both!