Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Approach 6: Use read_line instead of read_lines (Time: 105s)
In the read_lines method of BufReader, we allocated memory for each line. This can be seen via the malloc call that was made on each read_line. This meant an extra overhead of creating String on memory for each line. We now use a single buffer to store each line, this way we can avoid the expensive malloc
- Loading branch information