[comp.sys.mac] code optimizers

maiden@sdcsvax.UCSD.EDU (VLSI Layout Project) (09/21/87)

To the Macintosh Development Community:

Is there a significant interest market for an external optimizer for
the Macintosh/Macintosh II?  Recently some CS associates and I have
discussed the possibility of applying that 'ol computer science
knowledge toward developing such a product.

What do you, the development community, think?  Are existing compilers
sufficiently endowed with the ability to produce fast code?  Are those
developers who have bemoaned the lack of code quality on the Macintosh
comparable to that on other computers (including the PC) willing to
put their money where their mouth is?  IS THERE REALLY A MARKET FOR
AN OPTIMIZER - or are developers willing to exploit alternative
routes (hand-coded assembly by an expert)?

Also: are there such products already being developed?  There are
other things far easier (and more fun!) to do than making an 
optimizer; if someone is doing it already, we will willingly step 
aside and do something else.

And a final question: what are the specifications of an ideal code
optimizer?  What are the code size/speed tradeoffs that developers
out in the Macintosh community desire?  Obviously the optimizer
would be modular, allowing selective enabling/disabling of the
various levels of optimization, but is there a need for optimization
of ROM calls or cache use or coprocessor parallelism?

Presently we would envision the system to run under MPW - are there
objections to this? - and operate on assembler output to maximize
its functionality among several compilers.  We would consider
implementing loop optimization, induction variable and global common 
subexpression elimination, loop unrolling and merging, constant
folding, copy propagation, code hoisting, procedure call optimization,
etc.  It may be desirable to allow directives to be passed to the 
optimizer for greater control and implementation of other types of
optimization, including code substitution and algorithm optimization.

Your suggestions welcome.  E-mail is preferred, however I often
scan this board.

Edward
------------------------------------------------------------------------
UUCP: {seismo|decwrl}!sdcsvax!maiden     ARPA: maiden@sdcsvax.ucsd.edu

kdmoen@watcgl.UUCP (09/22/87)

>Is there a significant interest market for an external optimizer for
>the Macintosh/Macintosh II?  Recently some CS associates and I have
>discussed the possibility of applying that 'ol computer science
>knowledge toward developing such a product.

Sounds like a good idea.

>Presently we would envision the system to run under MPW - are there
>objections to this? - and operate on assembler output to maximize
>its functionality among several compilers.

The best way to do it is to write an optimizer that works directly
on code resources in compiled Macintosh applications.  That way,
you could take any standard Mac application, and optimize it.
The optimizer should be available as a standard Mac application,
it shouldn't restricted to MPW.  If you plan to sell this thing,
then these will be great selling points.  Your market will
not be restricted to developers:  anybody who wants to supercharge
their Mac software would be potential customers.
-- 
Doug Moen
University of Waterloo Computer Graphics Lab
UUCP:     {ihnp4,watmath}!watcgl!kdmoen
INTERNET: kdmoen@cgl.waterloo.edu

dorner@uxc.cso.uiuc.edu (09/24/87)

>>Is there a significant interest market for an external optimizer for
>>the Macintosh/Macintosh II?
>
>The best way to do it is to write an optimizer that works directly
>on code resources in compiled Macintosh applications.  That way,
>you could take any standard Mac application, and optimize it.

While this sounds good on the surface, I'd have to have a lot of faith
in an optimizer to do this, because the resultant application would have
had NO TESTING.  I'd much rather the optimization were done by the
developers, so that the optimized code would be tested (except for 
Microsoft, since they don't seem to do any testing :-)).
----
Steve Dorner, U of Illinois Computing Services Office
Internet: dorner@uxc.cso.uiuc.edu  UUCP: {ihnp4,seismo}!uiucuxc!dorner
IfUMust:  (217) 333-3339

wetter@tybalt.caltech.edu (Pierce T. Wetter) (09/26/87)

In article <174400056@uxc.cso.uiuc.edu> dorner@uxc.cso.uiuc.edu writes:
>
>>>Is there a significant interest market for an external optimizer for
>>>the Macintosh/Macintosh II?
>>
>>The best way to do it is to write an optimizer that works directly
>>on code resources in compiled Macintosh applications.  That way,
>>you could take any standard Mac application, and optimize it.
>
>While this sounds good on the surface, I'd have to have a lot of faith
>in an optimizer to do this, because the resultant application would have
>had NO TESTING.  I'd much rather the optimization were done by the
>developers, so that the optimized code would be tested (except for 
>Microsoft, since they don't seem to do any testing :-)).

  On the other hand, it would be pretty hard to screw up things like
mapping two move.w to one move.L. Or perhaps a "smart" segementer. Besides
your faith/lack of   will be determined by your experience. Also in general
copy protected code won't work if it checks to see if it has been modified.

  I think its a good idea but I don't know if I would pay for it.
  Pierce Wetter

The shortest distance between two points is under construction.
		-- Noelie Altito

--------------------------------------------

wetter@tybalt.caltech.edu

--------------------------------------------

tim@hoptoad.uucp (Tim Maroney) (09/26/87)

A new code optimizing phase would be great.  However, if it only works for
applications, forget it.  There is plenty of software on the Mac that is not
in application format, but could benefit from optimization.  This is not
only standard stuff like desk accessories and INITs and definition procs,
but also strange and unique one-project-only code resources that load
themselves into the system heap or above BufPtr.  The optimizer should work
on unlinked object code files, MPW format.  Other C developers should bring
their products into line with the MPW standard if they want to be able to
use compilation enhancement products for the Mac.
-- 
Tim Maroney, {ihnp4,sun,well,ptsfa,lll-crg}!hoptoad!tim (uucp)
hoptoad!tim@lll-crg (arpa)