Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apporach 2: Remove redundant creation of Vector while reading line (T…
…ime: 241s) In the 'read_line' function, we split the line at ';' and then collect the split data into a vector. This collection is redundant because we discard this vector at the end of function. The 'collect()' call has to make a system call to allocate some memory on heap, and since we do this for 1 billion lines - the extra overhead time for creating space for vector accumulates. Instead of using 'collect()' we only split the line and use the interators to extract the values. This removes the necessity of talking to the OS.
- Loading branch information