If you use memfiles then you can just map the whole file and let the OS page things in from disk on demand as necessary. This gives you a "whole file buffer for almost free" kind of user interface. After the first run or file creation/etc. there may be zero/little IO and also very little copying of data from kernel space to user space. You do need a real file name that is seekable (i.e. "stdin" may not work), but if that constraint is ok for you then mapped files is almost always the fastest way to go and among the easiest to use, too. You can look at the memSlices iterator in memfiles.nim for one example.
- Re: To optimize operation of replacement of lines in the f... Stefan_Salewski
- Re: To optimize operation of replacement of lines in ... Garry_Galler
- Re: To optimize operation of replacement of lines... Stefan_Salewski
- Re: To optimize operation of replacement of l... Garry_Galler
- Re: To optimize operation of replacement ... yglukhov
- Re: To optimize operation of replace... cblake
- Re: To optimize operation of rep... Stefan_Salewski
- Re: To optimize operation of rep... Garry_Galler
- Re: To optimize operation of rep... cblake
- Re: To optimize operation of rep... Garry_Galler
- Re: To optimize operation of rep... cblake
- Re: To optimize operation of rep... Garry_Galler
- Re: To optimize operation of rep... OderWat
- Re: To optimize operation of rep... Garry_Galler
- Re: To optimize operation of rep... OderWat