comp.lang.ada
 help / color / mirror / Atom feed
From: ian0kerr@my-deja.com (Ian)
Subject: Re: Little function generates lots of object code.
Date: 1 Oct 2001 05:18:52 -0700
Date: 2001-10-01T12:18:53+00:00	[thread overview]
Message-ID: <11bf7180.0110010418.46fb6a7c@posting.google.com> (raw)
In-Reply-To: 14df6e36.0109291652.73e61d20@posting.google.com

Mike_Harrison80@yahoo.com (Mike Harrison) wrote in message news:<14df6e36.0109291652.73e61d20@posting.google.com>...
> Hello group,
> 
> I am using AdaMulti 3.1 with a Sun target (optimized for size).  
> The following little function seems to be generating a lot more object
> code than it deserves.
> Is this what other people would expect?
> Is there something that I could do to reduce this?
> 
> .Mike.
> 
> ----------------------------------------------------------
>       function "-" (Right : in Matrix) return Matrix is  
>          Result : Matrix (Right'range(1), Right'range(2)); 
>       begin 
>          for Row in Right'range(1) loop 
>             for Column in Right'range(2) loop 
>                Result(Row,Column) := -Right(Row,Column); 
>             end loop; 
>          end loop; 
>          return Result; 
>       end "-";
> ----------------------------------------------------------
> 
> 
> 0x5c230:	.byte 	00,00,00,01 
>       function "-" (Right : in Matrix) return Matrix is  
.
.
.
.
.
> 0x5c3a0  M+0x16c:	0xb0100008  mov	%o0,%i0=implicit_dope_for_result
> 0x5c3a4  M+0x170:	0x81c7e008  ret
> 0x5c3a8  M+0x174:	0x91ea0000  restore	%o0,%g0,%o0
>       end "-";

Mike,
      If I can count correctly you have 6 semi-colons and 10 SLOCS
with
376 Bytes of object code. This gives 62.7 B per ;  and 37.6 B per
SLOC.
Out current project with a very much larger code base, using Rational
Apex
3.0.1 generating for a PPC604 target is loaded into FLASH and then
copied to RAM after which it is elaborated. We get 66.5 B per ; in
FLASH (this is maybe
object code with the libraries swamped out due to the large image
size). When copied into RAM and elaborated it grows to 133 B per ;

Looks like Greenhills MultiAda is about typical. If you want to
estimate the RAM needed, this expansion should be taken into account.
I was wondering if the increase is all explained by the heap. We
probably use a lot of this.

Has anyone got the correct answer to this?

Ian.



      parent reply	other threads:[~2001-10-01 12:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-30  0:52 Little function generates lots of object code Mike Harrison
2001-09-30 12:58 ` Robert Dewar
2001-10-01 12:18 ` Ian [this message]
replies disabled

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