[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference 7.286::atarist

Title:Atari ST, TT, & Falcon
Notice:Please read note 1.0 and its replies before posting!
Moderator:FUNYET::ANDERSON
Created:Mon Apr 04 1988
Last Modified:Tue May 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1433
Total number of notes:10312

181.0. "Pascal and the ST." by STAR::HEERMANCE (Mars needs RMS developers!) Tue Aug 02 1988 14:39

    OK, I'll admit it, I would rather program in Pascal than C.  My
    reasons are personal opinion and I'm not going to flame C.
    
    The reason I am writting this, however is that I am concerned
    about performance.  How does the code produced by the various
    Pascals (particularly OSS) compare against the code produced
    by MWC.  I have never performed a bench mark but I'm concerned
    mostly with string operations and loops, not floating point speed.
    
    Martin H.
T.RTitleUserPersonal
Name
DateLines
181.1Some ramblings about a Pascal-like language.PANGLS::BAILEYTue Aug 02 1988 19:5735
    I don't know about Pascal, but I can share my experience with Modula-2
    (TDI) versus C.  (Do you have a disassembler for your Pascal, or
    some way to generate machine language output from the compiler?)
    
    The Modula-2 code is really bad.  It never seems to do any variable
    ``caching'' at all.  That is, variables are operated upon in main
    memory at all times.  Expression calculation occurs in registers
    (I should hope so!) but all the register values seem to be discarded
    across expressions.
    
    It also doesn't do any peephole optimization at the end.  I have
    seen the following ridiculous code:
    
    	MOVE.L	D5,D5
    	MOVE.L	D5,xxx
    
    Actually this is only a beef with the code generated for the statement:
    
    	xxx := REGISTER(5);    (* Save D5 in xxx *)
    
    In C you can at force register based variable allocation, so they
    compiler doesn't have to feel obliged to perform register caching
    optimizations.
    
    MWC does seem to produce quite good code, but I like Modula enough
    to stick with it.  My programs almost always work if they compile
    and I knew what I was doing when I coded them.
    
    Some day soon, I'm going to get fed up and figure out how to make
    Modula-2 link in MWC object modules.  I really the services of a
    decent assembler.
    
    Steph
    
    
181.2STAR::HEERMANCEMars needs RMS developers!Tue Aug 02 1988 23:175
    Re: .1
    
    Nope, I don't have a disassembler.
    
    Martin
181.3Let's do a benchmark!MILRAT::WALLACEWed Aug 03 1988 15:304
    If you want to define some relevant benchmarks and code them in Pascal,
    I will volunteer to code them in C (MWC).
    
    	Ray
181.4STAR::HEERMANCEMars needs RMS developers!Wed Aug 03 1988 17:4913
    Re: .3
    
    My application is a forward and backward chainer.  XLISP is just
    to slow for this.  The relevant operations are loading the rule
    base and fact base from disk (disk i/o and memory allocation).
    Requesting a query from the user, and performing the search (string
    compares)
    
    A file sort program would probably have all the same characteristics.
    A reasonable benchmark would be load 1000 80 byte records into memory,
    bubble sort them, and write them back to disk.
    
    Martin H.
181.5File I/O metrics in judging compilersPRNSYS::LOMICKAJJeff LomickaFri Aug 05 1988 15:389
Be careful about doing file I/O metrics.

There's orders of magnitude of differences in performance in the
different ways you can do I/O on the Atari.  If, for example, you wish
to read a file into a buffer, doing a Fsetdta(), looking up the file size,
and read the file with a single Fread(), will read the file much, much
faster than if you were to read it with a lot of getc() calls, or even
with fread()s.

181.6size, speed, or both?MILRAT::WALLACEFri Aug 05 1988 16:195
    Good point Jeff!  Martin since your original note stated you were
    concerned about code generation specificaly in string handling and
    loops what about just coding the buble sort and comparing code size?
    
    	Ray
181.7STAR::HEERMANCEReturn of the Crash Dumps from HellMon Aug 08 1988 12:5621
    Re: .5
    
    Hmm, your quite right, another problem would be the relative
    fragmentation of our hard disks and Turbodos vs. FATSPEED vs.
    TOS alone.
    
    Re: .6
    
    Code size does not always equal quality.  I'm interested in
    speed of execution so I really wouldn't mind if compactness
    was sacrificed to gain speed (explicitly iterating loops is
    one example).
    
    As a modification to the original benchmark I'm going to have
    Pascal randomly generate 1000 records, sort them, and then
    print them to the screen.
    
    Another thing I'm currious about is which compiler can build
    call frames quicker.  A recursive benchmark would help here.
    
    Martin H.