🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #12847

Register Usage

#12847
From: Robert D. Silverman
Date: Tue, 20 Jan 1987 02:39
16 lines
1289 bytes
There is some ongoing discussion about register usage in programs.
While it is true that one generally wants to keep as many variables
as possible (especially such things as loop indices!) there are times
when using a lot of registers can actually slow things down.

This arises when a subroutine shares registers in common with its
parent. If the routine is called many times the cost of saving and
restoring registers during the call and return can offset any
speed savings thru register usage. I have actually seen this
phenomenon occur quite strikingly in programs that require 
multi-precision arithmetic. The cost of saving the registers for
a multi-precise add or multiply routine (say) when they are called
~10^8 or 10^9 times can greatly slow down a program.
 
Bob Silverman
Technical Details
Message-ID: <356@linus.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!cmcl2!yale!husc6!necntc!adelie!axiom!linus!bs

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!cmcl2!yale!husc6!necntc!adelie!axiom!linus!bs
From: bs@linus.UUCP (Robert D. Silverman)
Newsgroups: comp.arch,comp.lang.c
Subject: Register Usage
Message-ID: <356@linus.UUCP>
Date: Mon, 19-Jan-87 21:39:09 EST
Article-I.D.: linus.356
Posted: Mon Jan 19 21:39:09 1987
Date-Received: Wed, 21-Jan-87 00:05:55 EST
Organization: The MITRE Corp., Bedford, MA
Lines: 16
Keywords: Subroutine Frequency