Hello everyone.
Context
After coding in Java since I started CP, I thought of switching to Rust.
After using templates for fast IO, I thought of creating a decently working scanner myself.
I tried implementing input in 2 ways, but the way that I thought would be faster is slower, and I couldn't figure out why that is the case.
TLDR
Implementation 1: Taking input line-by-line.
Implementation 2: Storing bytes in a static buffer array.
I thought that the 2nd method is faster, since there are a lot of lines ($$$10^6$$$ test cases), and the buffer can store multiple lines in it.
Can someone please explain this?







