Re: object code vs. assembler code

byron@netapp.com (Byron Rakitzis)
Sat, 20 Feb 1993 01:18:33 GMT

          From comp.compilers

Related articles
object code vs. assembler code John_Burton@gec-epl.co.uk (1993-02-19)
Re: object code vs. assembler code byron@netapp.com (1993-02-20)
Re: object code vs. assembler code henry@zoo.toronto.edu (1993-02-21)
Re: object code vs. assembler code (Detailed response) clyde@hitech.com.au (1993-02-22)
Re: Object vs. Assembly from a compiler gorton@blorf.amt.tay.dec.com (1993-02-22)
| List of all articles for this month |
Newsgroups: comp.compilers
From: byron@netapp.com (Byron Rakitzis)
Keywords: assembler, performance
Organization: Network Appliance Corporation
References: 93-02-105
Date: Sat, 20 Feb 1993 01:18:33 GMT

John_Burton@gec-epl.co.uk writes:
>Obviously it is possible for a compiler to produce object code directly
>which seems to be the standard on many other systems which seems much more
>efficent to me.


>[Mostly it's a matter of taste. Some Unix assemblers, particularly the
>earlier ones, were very fast, so there needn't be a performance issue. -John]


Here are some real numbers to play with:


I ran the various stages of gcc-1.40 on 39 source files (about 7000 lines
of code) and timed each stage. These tests were run on a diskless Sun ELC
w/24M running 4.1.1.


Program User+Sys Total


cccp 2.4+6.8 == 9.2


cc1 25.4+6.5 == 31.9


/bin/as 5.0+6.3 == 11.3


So, assembly takes up about 20% of the total time. That's not
insignificant.


If you run a compiler with a faster code generator (such as lcc), then the
middle stage should be smaller by about a factor of 2 or 3, so assembly
can be as much as a quarter or a third of the total execution time.


(So why emit assembler? One of my long-term projects is to write a code
generator for lcc to use SPARC without register windows. I will initially
generate assembler, because it's the quickest way to get code working
(mainly because it's easy to debug). Eventually I would like to think
about generating object code directly, particularly if I try to
investigate some ideas related to linking (incremental linking, global
pointer..) where a new object format might be called for. I am
structuring the code so that switching from one to the other will require
a trivial amount of work.)


Byron Rakitzis.
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.