Re: MapViewOfFile v ReadFile experiments and results

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



<news@xxxxxxxxxxxxxxxxxx> wrote
[snip]
> > You might try disabling buffering. Read up on FILE_FLAG_NO_BUFFERING -
> > it places various constraints on how you call ReadFile. I don't know
> > whether it will actually speed things up though.
>
> Yes, I played with this option many moons ago, but only with ReadFile -
> it killed performance! However, I'm now wondering what it might do to
> MapViewOfFile. I'm guessing that in theory it should make no
> difference. Hmm - I might give that a go. If I do, I'll re-post the
> results.

Setting FILE_FLAG_NO_BUFFERING & FILE_FLAG_OVERLAPPED when creating the
mapping file give maximum performance for MapViewOfFile.


> I suspect, despite all this, that I'm at the limits of the speed of the
> disk subsystem. Not that that has ever stopped my trying. :)

Have you tried benchmarking the disk I/O using perfmon? 347 MB in 23.3s
(16.9 MB/s) is well short of current disk performance. Back in 1999 I was
seeing a steady 8 MB/s writing video to a Seagate Medallist disk on NT4.

-- Lawrence Rust, Software Systems, www.softsystem.co.uk


.



Relevant Pages

  • Re: Retrieve disk partitions (volumes) from Disk DevicePath
    ... the one of the disk device in question. ... volume of an USB floppy ... Is there a way to reinit a USB connected disk. ... ReadFile returns ERROR_INVALID_PARAMETER. ...
    (microsoft.public.development.device.drivers)
  • FileMapping, MapView, editing?
    ... When you CreateFileMapping and MapViewOfFile are changes made to the mapped view ... automatically written to disk when the mapping object is closed? ...
    (microsoft.public.vc.language)
  • Direct disk access: access denied
    ... I need to read raw data off a physical disk. ... using the CreateFile api, and then call ReadFile ... ReadFile always fails with error code 5: ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Retrieve disk partitions (volumes) from Disk DevicePath
    ... has DriveType DRIVE_FIXED or DRIVE_REMOVABLE (but not floppy drives!) ... the one of the disk device in question. ... volume of an USB floppy ... ReadFile returns ERROR_INVALID_PARAMETER. ...
    (microsoft.public.development.device.drivers)
  • Re: Direct disk access: access denied
    ... > I need to read raw data off a physical disk. ... > using the CreateFile api, ... > ReadFile always fails with error code 5: ...
    (microsoft.public.win32.programmer.kernel)