comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Re: How to speed up stream & record handling?
Date: Thu, 21 Feb 2002 23:59:00 GMT
Date: 2002-02-21T23:59:00+00:00	[thread overview]
Message-ID: <8Rfd8.41459$Cu.776895529@newssvr14.news.prodigy.com> (raw)
In-Reply-To: 87it8qeg4q.fsf@deneb.enyo.de

> Data_array'Read (and thus My_Record'Read) calls Unsigned_8'Read for
> each array element individually.  Perhaps this burns a lot of CPU
  I suspect you're right.  I ran the program as given on a 750MHz Windows
system and it took 7.7 seconds.  It runs in .13 seconds with some
simple changes:

   type My_Record is
     record
        A  : Data_array; -- 200 bytes
--      BC : B_And_C;    --   2 bytes
        BC : Byte_Array(1 .. 2);
     end record;
   buffer : my_record;
   package bio is new ada.sequential_io(my_record);
   ...
  for I in 1 .. 100000 loop
    bio.read(f,buffer);
    swap(buffer.bc);
  end loop;



  reply	other threads:[~2002-02-21 23:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-21 12:37 How to speed up stream & record handling? Karl Ran
2002-02-21 14:17 ` Martin Dowie
2002-02-21 17:34 ` Jeffrey Carter
2002-02-21 20:25 ` Florian Weimer
2002-02-21 23:59   ` tmoran [this message]
2002-02-22 13:31     ` Karl Ran
2002-02-22 20:25       ` tmoran
2002-02-24  3:23 ` Nick Roberts
replies disabled

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