Hello all...
I have this concern about redundant if statements.
I am coding a highly modularized C project and, of course, I want to get the best performance around.
As I know, the advantages of pipelining in processors are diminished by using an large number of conditional statements which reduce the chance of predictability over the program's execution path.
Now, considering that the structure of the code is going to be highly hierarchical (besides modular), I wonder if it wouldn't be the best to enforce parameter checking on the higher levels of the code and leave the params alone for the lower layers.
Usually, I proceed on checking virtually every parameter that gets into the function, but I believe that this would result in unnecessary wasted processor cycles.
My question is: Is this a wise/common thing to do in large application?
Thank you!
[red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
I have this concern about redundant if statements.
I am coding a highly modularized C project and, of course, I want to get the best performance around.
As I know, the advantages of pipelining in processors are diminished by using an large number of conditional statements which reduce the chance of predictability over the program's execution path.
Now, considering that the structure of the code is going to be highly hierarchical (besides modular), I wonder if it wouldn't be the best to enforce parameter checking on the higher levels of the code and leave the params alone for the lower layers.
Usually, I proceed on checking virtually every parameter that gets into the function, but I believe that this would result in unnecessary wasted processor cycles.
My question is: Is this a wise/common thing to do in large application?
Thank you!
[red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro