home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!usc!cs.utexas.edu!torn!news.ccs.queensu.ca!slip208.telnet1.QueensU.CA!dmurdoch
- From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
- Subject: Re: Performance questions
- Message-ID: <dmurdoch.296.726804572@mast.queensu.ca>
- Lines: 34
- Sender: news@knot.ccs.queensu.ca (Netnews control)
- Organization: Queen's University
- References: <07JAN93.21000832.0034@music.mus.polymtl.ca>
- Date: Tue, 12 Jan 1993 02:09:32 GMT
-
- In article <07JAN93.21000832.0034@music.mus.polymtl.ca> Steph <CT80@music.mus.polymtl.ca> writes:
-
- >1) I have seen often in 'C programs big functions separated in their
- > own .C file, to make their own separate .OBJ file. If I were to
- > do this in PASCAL, implementing one function per .TPU, would there
- > be any performance lags _at run time_?
-
- Yes, there'd be a performance lag, because you wouldn't have any near
- calls. Unless you turn it off, procedures local to a unit use the near call
- model. (Interfaced procedures are called by a PUSH CS and a near call, but
- use a far return.) You could use include files and still have one procedure
- per file without incurring any penalty other than slower compiles.
-
- BTW, one reason people would choose one procedure per file is to deal with
- dumb linkers that link things on an .OBJ by .OBJ basis; since the TP linker
- works on a procedure by procedure basis anyways, it's not necessary there.
-
- > reset(datafile, 1);
- > seek(datafile, random(100) * datasize);
- > blockread(datafile, data, datasize, bytesread);
-
- >(**** example two *****)
-
- > reset(datafile, datasize);
- > seek(datafile, random(100));
- > blockread(datafile, data, 1, records_read);
-
- >All I want to know if there is a difference, in _disk access_
- >between the two cases.
-
- No difference. The record size is purely a TP concept. DOS doesn't get
- told about it.
-
- Duncan Murdoch
-