MobileNativeFoundation / XCLogParser

Tool to parse Xcode and xcodebuild logs stored in the xcactivitylog format
Apache License 2.0
1.75k stars 125 forks source link

Replace Foundation scanner implementation #216

Open jrcmramos-bumble opened 3 weeks ago

jrcmramos-bumble commented 3 weeks ago

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