Re: High Level Language vs Assembly

Scott Moore <samiam@cisco.com>
4 Mar 2001 01:46:17 -0500

          From comp.compilers

Related articles
[10 earlier articles]
Re: High Level Language vs Assembly jacob@jacob.remcomp.fr (jacob navia) (2001-02-25)
Re: High Level Language vs Assembly tej@melbpc.org.au (Tim Josling) (2001-02-25)
Re: High Level Language vs Assembly henry@spsystems.net (2001-02-25)
Re: High Level Language vs Assembly fjh@cs.mu.OZ.AU (2001-02-25)
Re: High Level Language vs Assembly ts3@ukc.ac.uk (T.Shackell) (2001-03-01)
Re: High Level Language vs Assembly samiam@cisco.com (Scott Moore) (2001-03-01)
Re: High Level Language vs Assembly samiam@cisco.com (Scott Moore) (2001-03-04)
Re: High Level Language vs Assembly sunni@speakeasy.net (Shankar Unni) (2001-03-04)
Re: High Level Language vs Assembly ts3@ukc.ac.uk (T.Shackell) (2001-03-08)
Re: High Level Language vs Assembly kszabo@nortelnetworks.com (Kevin Szabo) (2001-03-08)
Re: High Level Language vs Assembly tfjellstrom@home.com (Tom Fjellstrom) (2001-03-10)
Re: High Level Language vs Assembly samiam@cisco.com (Scott Moore) (2001-03-10)
Re: High Level Language vs Assembly bobduff@world.std.com (Robert A Duff) (2001-03-10)
[8 later articles]
| List of all articles for this month |

From: Scott Moore <samiam@cisco.com>
Newsgroups: comp.compilers
Date: 4 Mar 2001 01:46:17 -0500
Organization: Cisco Systems Inc.
References: 01-02-094 01-02-101 01-03-015
Keywords: assembler, performance, comment
Posted-Date: 04 Mar 2001 01:46:17 EST

"T.Shackell" wrote:
> I wanted using C alone and I knew I was using the best (known)
> algorithms. When I dropped the inner loop of the rasterizer into ASM
> and carefully hand optimized it I found I got a performance increase
> of around 120%. I think the key was I was only trying to hand-code
> less than 10 lines of C in a loop the CPU was in 95% of the time.


And interestingly, the next level of performance optimization is to go
back to high level language, that is, using "online" compilation. The
idea is that you build an assembly program while running just to solve
the problem with all the parameters at hand. For example, you have a
series of graphic figures to draw, you can make a general C routine,
an assembly routine, or you can generate a section of assembly
(actually machine) code that specifically draws the
figures. Generating it is costly, but pays off in long redundant
sequences.


Thats how high level language can be faster than assembly code.
--
Scott A. Moore is samiam@cisco.com
[This is a swell idea, and it's very well known. Mainframe sort
programs were generating machine code for the inner loop by the early
1960s, and probably did so in the 1950s. -John]


Post a followup to this message

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