Michael Schnell schrieb:
 On 07/13/2010 11:18 PM, Hans-Peter Diettrich wrote:
When we rely on an OS file chache, we can read all files entirely into memory, instead of using buffered I/O.
Loading the complete file instead of parts of it would do unnecessary memory copies.

How that? Of course the entire file uses more address space than a smaller buffer, but when the file is parsed, the same number of bytes must be copied to local memory in either case.

And when the entire file sits in memory, the scanner and parser operations can be optimized for much higher speed, by e.g. removing unnecessary address calculations, bounds checks and string copies.

In fact I suppose using file mapping instead of read (and maybe write) should improve speed in many cases.

Therefore my question about a platform independent solution for MMF.

At least we could implement a MMF (source) file class, that emulates this feature on platforms without MMF support. Support also could be restricted to map only entire files, for the compiler - otherwise the management of mapping windows would degrade the achievable performance.

DoDi

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to