Original Post
I have an array of function pointers
[source lang="cpp"]void a();
void b();
void c();
void d();
jump={a, b, c, d};[/source]
I'm indirectly calling those functions in a loop
[source lang="cpp"]while(some_condition)
{
int i=...//i is random
jump();
}[/source]
If i is consistent, not just random values, does the loop run faster?
Does the cpu predict which function to call like in branch prediction?
[source lang="cpp"]void a();
void b();
void c();
void d();
jump={a, b, c, d};[/source]
I'm indirectly calling those functions in a loop
[source lang="cpp"]while(some_condition)
{
int i=...//i is random
jump();
}[/source]
If i is consistent, not just random values, does the loop run faster?
Does the cpu predict which function to call like in branch prediction?