Quantcast
Channel: Why is C++ unnecessary loop making program faster? - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Joni for Why is C++ unnecessary loop making program faster?

Assuming such a useless loop has any effect on the compiled code, one source of performance difference could be branch instructions falling in different buckets, making branch prediction in the CPU...

View Article



Answer by keelar for Why is C++ unnecessary loop making program faster?

I think most of the compilers will ignore the following statement you mentioned:for (int _delay = 0; _delay < 500000000; _delay++ );since the for-loop does nothing but merely modifying a local...

View Article

Why is C++ unnecessary loop making program faster?

I was practicing on some competitive programming site, like UVa or LOj and noticed several times(10 times or more!) that putting an unnecessary loop in my program, for example, putting this at the...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images