Skip to content

Commit

Permalink
Approach 7: Use bytes instead of strings(Time: 83s)
Browse files Browse the repository at this point in the history
The `read_lines` and `read_line` method stored the line as a String.
Strings in rust needs to be UTF8, the previous approach validated
this on each line which caused some overhead.

We replace strings with bytes and only validate the string while
printing. Playing with bytes is also much cheaper because you are dealing
with raw data.
  • Loading branch information
Naveenaidu committed Jul 14, 2024
1 parent d4b60cf commit 2bc8cc3
Show file tree
Hide file tree
Showing 2 changed files with 506 additions and 14 deletions.
Loading

0 comments on commit 2bc8cc3

Please sign in to comment.