home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 1: Collection A / 17Bit_Collection_A.iso / files / 174.dms / 174.adf / ASDG-rrd / Notes < prev    next >
Text File  |  1988-07-25  |  5KB  |  120 lines

  1. Article 1715 of comp.sys.amiga:
  2. Path: mcdsun!noao!hao!ames!lll-lcc!well!perry
  3. From: perry@well.UUCP (Perry S. Kivolowitz)
  4. Newsgroups: comp.sys.amiga
  5. Subject: Overhead And Implementation Notes of ASDG RRD
  6. Keywords: in response to Kim's note
  7. Message-ID: <2482@well.UUCP>
  8. Date: 26 Jan 87 18:54:14 GMT
  9. Lines: 107
  10.  
  11.  
  12.     Some poeple have asked for more information about the ASDG Recoverable
  13. Ram Disk internals,  specifically how  implementation  details  affect  memory
  14. usage and performance.
  15.  
  16.     First,  the ASDG RRD is a track disk driver. This differs considerable
  17. from the implementation of RAM:. See Figure 1 for a quick block diagram.
  18.  
  19.     Floppies and VD0:
  20.  
  21.     Exec Proper <---------> File Handler <---------> TrackDisk Device
  22.  
  23.     RAM:
  24.  
  25.         Exec Proper <---------> Ram Handler
  26.  
  27.     (Figure 1)
  28.  
  29.     This fundemental difference between the implementation of VD0: and RAM:
  30. leads to many differences in other ways:
  31.  
  32.     (1) VD0:  is  totally  compatible  with  AmigaDOS since it is dependent
  33.         upon the  very same  FileHandler to  implement a file system as the
  34.         floppies use.
  35.  
  36.         Because the RamHandler has  to provide all of the outward function-
  37.         ality  of  a FileHandler,  this  functionality was reimplemented in
  38.         the RamHandler. Unfortunately, there are still some incompatibilit-
  39.         ies between RamHandler and FileHandler which manifest themselves as
  40.         bugs such as the 1.2 ``can't  delete a directory from the workbench
  41.         bug.''
  42.  
  43.     (2) Speed of RAM: to RAM:  transfers  are much faster than VD0: to VD0:
  44.         since the ram:  device  simply  passes  blocks around inside itself
  45.         while vd0: must  pass blocks to the filehandler and then accept the
  46.         blocks from the filehandler in return.
  47.  
  48.     (3) RAM: can sometimes use space more  efficiently (and sometime less).
  49.         This is what Kim@Amdahl   brought up. He said that for 60 files and
  50.         some number of  directories, 128K  of memory seemed to disappear as
  51.         ``overhead.''
  52.  
  53.         The ASDG RRD allocates a track at a time. If the AmigaDOS FileHand-
  54.         ler says ``allocate  exactly 1 sector per track'' a full 8K will be
  55.         allocated. This space is *not* lost however  since  the FileHandler
  56.         ultimately gets around to allocating other sectors per track.
  57.  
  58.         Remember, asdg.vdisk.device  does  make decisions over where to put
  59.         data on the logical  disk, it is only  responsible  for making sure
  60.         a block request made by the FileHandler is satisfied.
  61.  
  62.         In Kim's case, AmigaDOS has obviously made some choices about where
  63.         to put blocks which resulted in tracks not being completely consum-
  64.         ed before other tracks were allocated.
  65.  
  66.          This apparent ``overhead'' disappears  as  the RRD becomes full and
  67.         tracks become used completely.
  68.  
  69.         What follows is a more complete study of memory overhead.
  70.  
  71.         A completely empty vd0:
  72.  
  73.         6K used by driver code.
  74.         4K used by AmigaDOS to deal with driver.
  75.         8K used by root track (only preallocated track).
  76.         7K used by miscellaneous data.
  77.  
  78.         For a total of 25K of memory gone just to give you an empty
  79.         disk. RAM: immediately after initialization consumes 9K.
  80.  
  81.         Of this, the 8K for the root track is not overhead since you're
  82.         going to need  the  space anyway. This leaves 8K above the RAM:
  83.         device in overhead.
  84.  
  85.         Each track consumes:
  86.  
  87.         142 bytes  of overhead. This includes a checksum for every sec-
  88.         tor and some magic cookies I need.
  89.  
  90.         My studies indicate the AmigaDOS   makes  much better block assign-
  91.         ments for small  files than large  ones. That is:  an 8K files will
  92.         cause 8K worth of  memory  to be used by VD0: while a 55K file will
  93.         cause 65K worth of memory to  be used assuming  you're copying onto
  94.         a completely empty file system. Note (again) that you will get full
  95.         use out of the ``missing'' 10K. Later, when  FileHandler puts other
  96.         things on the mostly empty tracks it's allocated.
  97.  
  98.         On the whole, while VD0: may  use  more memory early on, the memory
  99.         utilzation  of VD0: as the device becomes  full approaches the opt-
  100.         imal amount needed to store the data itself.
  101.  
  102.     A while back when Fred Fish posted Rick Spanbauer's Disk Benchmark res-
  103.     ults, the write speed on VD0: was slower  than  the read speed. This is
  104.     because during writes a checksum of each sector written is taken.
  105.  
  106.     The checksum for each sector  is  useful  in finding single byte or bit
  107.     errors which  would  otherwize  cause you to use corrupted data without
  108.     knowing it. And then again,  most  operations on the ram disk are reads
  109.     anyway (with no performance degradation).
  110.  
  111.     I might add that on a  68010  Amiga,  the performance was about 5Kbytes
  112.     per second faster than Fred's results. I guess this is the influence of
  113.     tight loops (very tight, 2 instructions) running faster.
  114.  
  115. Perry S. Kivolowitz
  116. ASDG Incorporated
  117. (201) 540-9670
  118.  
  119.  
  120.