home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.forth
- Path: sparky!uunet!ftpbox!mothost!merlin.dev.cdx.mot.com!pjd.dev.cdx.mot.com!peterd
- From: peterd@pjd.dev.cdx.mot.com (Peter Desnoyers)
- Subject: Re: Block versus file
- Message-ID: <peterd.716589398@pjd.dev.cdx.mot.com>
- Sender: news@merlin.dev.cdx.mot.com (USENET News System)
- Nntp-Posting-Host: pjd.dev.cdx.mot.com
- Organization: Motorola Codex, Canton, Massachusetts
- References: <dak.716483390@messua> <1992Sep14.175419.20951@Informatik.TU-Muenchen.DE>
- Date: Tue, 15 Sep 1992 20:36:38 GMT
- Lines: 42
-
- pazsan@Informatik.TU-Muenchen.DE (Bernd Paysan) writes:
-
- >Well, I have thougth quite a long time about the screen vs. stream
- >problem. I do not agree withsome of David's points.
-
- >DK>Any block structure imposed artificially on the
- >DK>top of the file system will be SLOWER than fully utilizing the
- >DK>file system.
-
- >Almost every file system HAS a block structure below it, and in many
- >cases, blocks are a 2^n bytes chunck with n integer and n<=10. So reading
- >a Forth block (1K) is straigt forward, unbufferd and faster than
- >arbitrary reading (while "arbitrary" means: less than block size).
-
- The concept of buffered I/O has been known for a long time. Forth doesn't
- have a monopoly on it. However, the natural read size for most file
- systems that I know of is more in the range of 4K-8K. A reasonable
- interface to the host filesystem will let you read arbitrary blocks,
- where arbitrary means any size you can specify.
-
- > Even
- >for my stream file interface I read and write blocks of 2^n bytes (where
- >n depends on what I found useful).
-
- I'm glad to see that you discovered buffering, too.
-
- >With scanning for line ends stream
- >file interpretation is SLOWER than block file interpretation, although
- >less blocks are to read.
-
- It's nice to know that your parser is slower on one file type than
- another. That really doesn't tell us much about file I/O performance.
-
- How about creating a benchmark? Create a large file - say a meg or so -
- and read it into program buffers either (1) Forth block by Forth block,
- or (2) by using sequential file read commands with a reasonable buffer
- size, such as 16K. Both are going to translate to the same file system
- requests - the only difference is that the buffer size is going to be
- more reasonable in case (2).
-
- Peter Desnoyers
- --
-