Re: Experiences using "register"
- From: Richard <devr_@xxxxxxxxx>
- Date: Sun, 30 Mar 2008 20:02:37 +0200
Ioannis Vranos <ivranos@xxxxxxxxxxxxxxxxxxxxxxxxx> writes:
Willem wrote:
Ioannis wrote:
) Yes, what I am saying about "register" and small scopes is a general
) good practice.
But are you saying that using "register" in small scopes
is the only 'proper use' ? And that using it in larger
scopes is therefore 'improper use' ?
I am saying that using "register" in small scopes is a general good
practice when using this keyword, the same way as using "inline" with
small functions is a general good practice.
Naturally there are exceptions to these rules.
An exception example for "register" is when we want a specific portion
of code to run as fast as possible without caring about run-time
efficiency of the rest of the code because of this.
Now you're talking at odds. One part can not be efficient and the rest
inefficient if its all mixed up and in the same thread.
Bottom line is that it depends on the circumstances. There are many
"large" functions which, if its a poor compiler, would benefit from
register on a variable used through out that large function.
An exception example for "inline" is when we want a large function with
many calls to be called as fast as possible, without caring about space
efficiency.
Which is rare especially if paging happens as a result of the code
increase.
Large functions are rarely called frequently enough to have the overhead
of the call/return to have any noticeable impact.
.
- Follow-Ups:
- Re: Experiences using "register"
- From: Willem
- Re: Experiences using "register"
- References:
- Experiences using "register"
- From: Spiros Bousbouras
- Re: Experiences using "register"
- From: Ioannis Vranos
- Re: Experiences using "register"
- From: Richard
- Re: Experiences using "register"
- From: Ioannis Vranos
- Re: Experiences using "register"
- From: Willem
- Re: Experiences using "register"
- From: Ioannis Vranos
- Re: Experiences using "register"
- From: Richard
- Re: Experiences using "register"
- From: Ioannis Vranos
- Re: Experiences using "register"
- From: Willem
- Re: Experiences using "register"
- From: Ioannis Vranos
- Re: Experiences using "register"
- From: Richard
- Re: Experiences using "register"
- From: Ioannis Vranos
- Re: Experiences using "register"
- From: Ioannis Vranos
- Re: Experiences using "register"
- From: Willem
- Re: Experiences using "register"
- From: Ioannis Vranos
- Re: Experiences using "register"
- From: Willem
- Re: Experiences using "register"
- From: Ioannis Vranos
- Re: Experiences using "register"
- From: Willem
- Re: Experiences using "register"
- From: Ioannis Vranos
- Re: Experiences using "register"
- From: Willem
- Re: Experiences using "register"
- From: Ioannis Vranos
- Experiences using "register"
- Prev by Date: Re: Backtrace function
- Next by Date: Re: ?: as an lvalue
- Previous by thread: Re: Experiences using "register"
- Next by thread: Re: Experiences using "register"
- Index(es):
Relevant Pages
|