comp.lang.ada
 help / color / mirror / Atom feed
From: mfb@mbunix.mitre.org (Michael F Brenner)
Subject: Re: Packing Record Structures in Ada
Date: 1998/01/15
Date: 1998-01-15T00:00:00+00:00	[thread overview]
Message-ID: <69la3r$8vq@top.mitre.org> (raw)
In-Reply-To: m267no4ccx.fsf@wf-rch.cirr.com


  > I have done tests of streaming vs direct layout and copying using
  > GNAT.  Streaming is rather slow, on the order of 20 times slower than
  > direct copying. 

Because of the bugs in the current version of gnat for DOS streaming,
I recommend putting off implementing stream-io until after the next
version of gnat for DOS is released by some volunteer someday.

Timing on DOS shows that copying files with stream-io is the fastest
way Ada can do it (faster than calling the C-library getc and putc,
faster than text_io, faster than sequential_IO, faster than
direct_IO, and faster than doing a djgpp DOS call for buffering
the reads 32K at a time). 

When you say it is 20 times lower than direct copying, you mean
it is 20 times slower than a REAL mode copy command. Since
you probably restricted your Ada code to run in PROTECTED mode,
that is not a fair test. When you compare the Ada code to 
assembly code running in PROTECTED mode and using the DOS calls
in REAL mode to do the copying, you will find the Ada code runs
just as fast as the assembly code. 

Going back and forth between REAL and PROTECTED mode takes time.
That is the one weakness of DOS under the djgpp extender, it does
not have PROTECTED mode I/O and so goes down to REAL mode to get
all of its I/O handled.




  parent reply	other threads:[~1998-01-15  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-12  0:00 Packing Record Structures in Ada Randall_Rathbun
1998-01-12  0:00 ` Matthew Heaney
1998-01-13  0:00 ` Robert Dewar
1998-01-13  0:00   ` Corey Minyard
1998-01-13  0:00     ` Robert Dewar
1998-01-15  0:00     ` Michael F Brenner [this message]
1998-01-15  0:00       ` Robert Dewar
1998-01-19  0:00 ` Anonymous
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox