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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1769ac558c6fa259 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-21 06:16:38 PST From: "Martin Dowie" Newsgroups: comp.lang.ada References: Subject: Re: How to speed up stream & record handling? Date: Thu, 21 Feb 2002 14:17:00 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 NNTP-Posting-Host: ed125012.sd.edinbr.gmav.gecm.com Message-ID: <3c75013f$1@pull.gecm.com> X-Trace: 21 Feb 2002 14:16:31 GMT, ed125012.sd.edinbr.gmav.gecm.com Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!btnet-peer1!btnet-feed3!btnet!newreader.ukcore.bt.net!pull.gecm.com!ed125012.sd.edinbr.gmav.gecm.com Xref: archiver1.google.com comp.lang.ada:20208 Date: 2002-02-21T14:17:00+00:00 List-Id: "Karl Ran" wrote in message news:e7ebd224.0202210437.1c7d0fbf@posting.google.com... > I've a problem getting a reasonable IO preformance from an Ada > program (source is attached) > > The environment looks like this: > OS: linux-2.4.16 > CPU: Intel P3/700 MHz / BX chipset > compiler: gnat-3.14p Have you tried varying compiler optimisations? i.e. -O3 instead of -O0? The swap routine looks a little extravagant. You already know that B_And_C is 2 bytes. Try: type Byte_Array is array (Positive range 1 .. 2) of Unsigned_8; -- This procedure reverses the oder of the bytes in its argument. procedure Swap ( The_Bytes : in out Byte_Array ) is Temp : Unsigned_8 := The_Bytes (1); begin The_Bytes (1) := The_Bytes (2); The_Bytes (2) := Temp; end Swap; and see if that makes any difference. You could also try inlining your swap routine. Hope this helps! Slainte! Martin