Confusing optimization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



void a()
{
	... do my stuff
}

void b()
{
	... do my stuff
}

int main(int argc, char *argv[])
{
	a();
	b();	
}

>g++ main.cpp -O3
>./a.out
a takes 125ms
b takes 340ms

now the same but seperated
int main(int argc, char *argv[])
{
	a();
}

>g++ main.cpp -O3
>./a.out
a takes 85ms

Is this normal ? b has nothing todo with a .. why does a get slower ?
(b is also faster without a...)

Luca.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux