From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3110709241972620 X-Google-Attributes: gid103376,public From: mfb@mbunix.mitre.org (Michael F Brenner) Subject: Re: Packing Record Structures in Ada Date: 1998/01/15 Message-ID: <69la3r$8vq@top.mitre.org>#1/1 X-Deja-AN: 316217390 References: <884639188.24707084@dejanews.com> Organization: The MITRE Corporation, Bedford Mass. Newsgroups: comp.lang.ada Date: 1998-01-15T00:00:00+00:00 List-Id: > 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.