home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / pascal / 8055 < prev    next >
Encoding:
Text File  |  1993-01-11  |  1.8 KB  |  46 lines

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