Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Approach 8: Use mmap and bytes everywhere (Time: 78s)
In this appraoch we do two things: 1. Use mmap so that we can directly use bytes insted of depending on vectors 2. Replace all instances of Vec to bytes We can see from the previous flamegraph that `to_vec` takes almost 14% of the cycle in `read_line` function. The motivation to use mmap here was to convert everything in bytes so that we can reduce the allocation of memory on Heap for every line. P.S: I hate the use of unsafe here, but I'm going with it for now and plan to change it later once I make other stuff performant
- Loading branch information