[comp.sys.mac] LSC Programming Tools: and improved arithmetic.

simon@alberta.UUCP (10/30/87)

I think this may have been discussed before, but we have a problem now.
Running a program that is primarily arithmetic operations, written in C
and compiled in LSC with floats, is much slower than the equivalent
written in fortran.  This all on a Mac plus, and no data structure
fancier than a 2-d array.  I realise that most, if not all, of the
difference arises from the conversion to double before the arithmetic operation
in SANE, then the conversion back to float.  Memory restrictions prevent us
using double all the way.  (Correct me if any assumptions so far are 
inaccurate.)
So, knowing that the two may be mutually exclusive, what is
  a) the easiest, and b) the best way to regain the competitive edge against
the fortran code runtimes?  Thanks in advance.
  -------------------  
W. Simon Tortike
Dept Min, Met &    UUCP:   {ubc-vision,ihnp4,mnetor}!alberta!simon
  Petroleum Engg   BITNET: stortike@ualtavm
Univ. of Alberta   AGT:    (403) 432-3338
Edmonton, AB
Canada T6G 2G6

singer@endor.UUCP (11/02/87)

In article <226@pembina.UUCP> simon@alberta.UUCP (Simon Tortike) writes:
>
>Running a program that is primarily arithmetic operations, written in C
>and compiled in LSC with floats, is much slower than the equivalent
>written in fortran.  This all on a Mac plus, and no data structure

	I assume here that you're referring to MS Fortran. MS Fortran doesn't
use the SANE data types and trap calls, and as a result is about ten
times faster than any calls that use the SANE traps. The way to  get some
speed back is to use doubles as much as possible, but given your memory
constraints you may be stuck.

		--Rich

**The opinions stated herein are my own opinions and do not necessarily
represent the policies or opinions of my employer (THINK Technologies, Inc).

* Richard M. Siegel | {decvax, ucbvax, sun}!harvard!endor!singer    *
* Customer Support  | singer@endor.harvard.edu			    *
* Symantec, THINK Technologies Division.  (No snappy quote)         *