Thread: why page based I/O can improve performance?

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    why page based I/O can improve performance?

    Hello everyone,


    I heard that page based I/O can improve performance, so some guys developed some page based I/O library which reads a file in page unit. For example, when we read the first byte, they will read an entire page (for example, 4k bytes) into memory, then when we are seeking to some other bytes inside a page, the bytes can be found from the page loaded in memory.

    But, I also heard that when accessing OS File I/O, OS File I/O library implements page based I/O internally, for example, when you just read a byte using fseek or something, it will reads a whole page (maybe 4k or something) into memory.

    My question is, which is true (OS provides page based I/O internally or not)? If OS provides page based I/O, why some guys always say that they are using page based I/O to improve performance.


    thanks in advance,
    George

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    it probably depends on the os, but today's fast hard drive access time attempting to do page-based i/o will yield little, if any benefits. 10-20 years ago it would have been highly beneficial, but not any longer. I know for a fast that MS-Windows already optimizes disk-io by reading ahead and trying to anticipage the next read request. Unless you set up your program to do unbuffered i/o the os will read one or more pages into memory. We don't need to be concerned about that in normal application programs that run on hardware built in the last 5 or 6 years. If you are still running 20-year-old hardware, shame on you!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Page File counter and Private Bytes Counter
    By George2 in forum Tech Board
    Replies: 0
    Last Post: 01-31-2008, 03:17 AM
  2. page fault
    By George2 in forum C++ Programming
    Replies: 9
    Last Post: 01-10-2008, 06:27 AM
  3. virtual memory
    By sweets in forum C Programming
    Replies: 6
    Last Post: 11-06-2004, 06:55 AM
  4. C Graphics - Page Flipping
    By z0diac in forum C Programming
    Replies: 1
    Last Post: 10-29-2002, 01:21 AM