comp.lang.ada
 help / color / mirror / Atom feed
From: visicom!rlk@nosc.mil  (Bob Kitzberger)
Subject: Re: Ada Embedded Systems Efficiencies
Date: 25 Feb 93 19:58:29 GMT	[thread overview]
Message-ID: <295@VisiCom.COM> (raw)

wisniews@saifr00.cfsat.honeywell.com (Joe Wisniewski) writes:

>I am concerned that "good design" macro-efficiencies are going to be "un-done"
>due to perceived net overall gain of over-implementing micro-efficiencies.

Personally, I'd avoid altering the structure of the application in order
to take advantage of small micro-efficiencies.  There are certain
micro-efficiencies that can reduce memory usage, while not altering the
structure of the application at all.  

For example, an understanding of how the compiler lays out memory helps in
identifying and avoiding hot spots, and its surprising how often these
things are ignored, especially by developers new to the world of
embedded systems (no flames intended; this is merely an observation that
memory usage and determinism are rarely as critical in host-based systems
as they are on embedded systems).

For example, if a developer declares a large array of records, they may
not be aware that there may be a lot of 'white space' in their record
layout (inserted by the compiler for efficiency reasons), and a pragma pack
is often in order.  This is a micro-efficiency, but requires no structural
changes to the application.  

Also, a developer may not be aware of the impact of tasks on memory usage.
Specifically, each task usually has some fairly large default stack size.
In order to specify an alternate stack size, the task must be declared
using a task type (since the storage size clause can only be specified
on a task type, not on a task object).  Using the default stack size on
every task can add up quickly.  Again, this is a micro-efficiency, but
it requires no structural changes in order to fix it.  (Add another
thing to the Ada Rules of Thumb: always use task types, even if declaring
a single task of that type).

We are currently undergoing a size reduction effort on a large tightly-
coupled multiprocessor system.  The first step we are taking is to develop
tools to effectively report the actual memory usage of the application.
This includes:

	1. Compiler listings that show CODE, DATA, CONST, BSS usage

	2. Runtime hooks into memory allocation routines to get a handle
           on dynamic memory usage

        3. Task stack usage analysis (allows tuning of stack sizes).

  	4. Reporting of memory usage for each build

Each developer gets the memory usage report, along with a list of deltas
in memory usage from the previous build.  It is felt that individual developers
can effectively take the first pass at reducing memory usage in the areas they
are most familiar with.  A second pass would look at things from a systems
point of view.  

	.Bob.
----------------
Bob Kitzberger          VisiCom Laboratories, Inc.
rlk@visicom.com         10052 Mesa Ridge Court, San Diego CA 92121 USA
                        +1 619 457 2111    FAX +1 619 457 0888

             reply	other threads:[~1993-02-25 19:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-02-25 19:58 Bob Kitzberger [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-02-25 20:36 Ada Embedded Systems Efficiencies enterpoop.mit.edu!spool.mu.edu!howland.reston.ans.net!paladin.american.ed
1993-02-26  5:59 Alex Blakemore
     [not found] <1993Feb24.212146.13157@saifr00.cfsat.honeywell.com>
1993-02-26 15:10 ` MILLS,JOHN M.
1993-03-02 20:10   ` Greg Franks
1993-03-02 22:36 ` Tom Wicklund
1993-03-03 14:39   ` Gerald Walls
1993-03-03 23:24     ` Mike Berman
1993-03-04  1:50       ` Dave Bashford
1993-03-05 21:21 agate!howland.reston.ans.net!zaphod.mps.ohio-state.edu!saimiri.primate.wi
replies disabled

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