Instant access to line from a large file without loading the file
问题 In one of my recent projects I need to perform this simple task but I'm not sure what is the most efficient way to do so. I have several large text files (>5GB) and I need to continuously extract random lines from those files. The requirements are: I can't load the files into memory, I need to perform this very efficiently ( >>1000 lines a second), and preferably I need to do as less pre-processing as possible. The files consists of many short lines ~(20 mil lines). The "raw" files has