Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compilers > Re: Reordering ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 11 Topic 2331 of 2474
Post > Topic >>

Re: Reordering of functions

by Joel Yliluoma <bisqwit@[EMAIL PROTECTED] > Feb 19, 2008 at 11:33 AM

On Mon, 18 Feb 2008 17:22:52 +0100, Tim Frink wrote:
> I've a question about the influence of compiler optimizations that
> reorder functions on the system performance.
>
> Assume a modern processor with all state-of-the art features like
> prefetching, branch prediction and a superscalar pipeline. Further
> assume that all caches are disabled. Will the program runtime change
> when just the order of functions is changed (without any other code
> transformation)?

Aren't "with branch prediction" and "caches are disabled" somewhat
mutually exclusive statements?

As I understand it, the processor does branch prediction based on
past experience (which is cached using some hash generated
from the instruction address), or lacking experience, heuristics.

If such cache exists, then function reordering might help in cases
where multiple functions have jumps in identically ha****ng addresses
with identical probabilities. I find that to be unlikely.

> I'm of the opinion that a reordering of function should have little
> influence on the program execution, maybe due to some prefetch effects
> but thes should be marginal.  Of course, with caches this situation
> would look different.

Function reordering might help also in situations where the processor
sup****ts jumps that are differently encoded depending on the jump length
(such as the bra/brl opcodes on 65c816, or similar on x86). If a tailcall
occurs to a function that is located within a short distance, it might
be faster with than a tailcall with a larger distance, because the opcodes
differ.

In any case, I think the effects of cache (and/or demand loading) are
greatly more significant than those which I listed, regarding the function
ordering.

--
Joel Yliluoma - http://iki.fi/bisqwit/
 




 11 Posts in Topic:
Reordering of functions
Tim Frink <plfriko@[EM  2008-02-18 17:22:52 
Re: Reordering of functions
"Nikolai Kim" &  2008-02-18 22:33:31 
Re: Reordering of functions
Tim Frink <plfriko@[EM  2008-02-21 09:53:21 
Re: Reordering of functions
=?ISO-8859-15?Q?Jan_Vorbr  2008-02-25 11:39:05 
Re: Reordering of functions
Joel Yliluoma <bisqwit  2008-02-19 11:33:56 
Re: Reordering of functions
Tim Frink <plfriko@[EM  2008-02-21 09:41:38 
Re: Reordering of functions
glen herrmannsfeldt <g  2008-02-24 01:59:56 
Re: Reordering of functions
Chris F Clark <cfc@[EM  2008-02-19 09:55:43 
Re: Reordering of functions
Tim Frink <plfriko@[EM  2008-02-21 09:36:08 
Re: Reordering of functions
Chris F Clark <cfc@[EM  2008-02-24 17:57:01 
Re: Reordering of functions
George Neuner <gneuner  2008-02-25 17:15:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 1:19:04 CDT 2008.