[IO] further improve readlines() performance against large file
by reading entire file into memory