Using stringstream was a big source of inneficient memory usage on insert_from_stdin