[please cc me in replies, as I’m not subscribed to this list] Before this change, zsh startup time was dominated by lseek(2) system calls on the history file, as shown by strace -c: time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 97,35 1,112890 1 697153 1 lseek 0,99 0,011314 2 5277 read […] This change keeps track of read bytes and the position within the file, removing all of these system calls. I verified correctness of the change by comparing fpos with ftell(in) in every loop iteration.