in reply to Re^3: Configurable IO buffersize?
in thread Configurable IO buffersize?
Have you ever thought of using memory mapped files ...
For other things yes, but not for this. I'm not sure how that would work for this application? Especially as the files are text files and are read/written in terms of lines.
The scenario is that (at different stages in the application), I'm interleaving either reads from, or writes to, many files. This has the affect of causing the disk head to need to dance all over the disk whenever a 4k buffer is used up. If I can buffer (say) 1MB at a time, that will cut the number of disk seeks by 1/256, which should have a significant affect on throughput.
If I use memory mapping I have to bypass the OS/CRT/PERLIO line handling, and by moving that into Perl I think I would loose more than I might gain.
Configurable CRT buffer sizes avoids that problem. Maybe the right solution is to write a module that gives back direct access to the CRT stdio on all platforms.
|
|---|