Why infinite loops are faster than finite loops?
tastyminerals via Digitalmars-d-learn Sat, 20 Jun 2020 14:15:48 -0700
I am not sure that this is a question about D or a more general
one. I have watched this nice presentation "Speed Is Found In The
Minds of People" by Andrei:
https://www.youtube.com/watch?v=FJJTYQYB1JQ&feature=youtu.be?t=2596 and on 43:20 he says that "push_heap" is slow because of structured loops and finite for (throughout the presentation Andrei shows algorithm examples with infinite loops). I wonder why is that? Is it because the finite loop needs to keep track of the number of iterations it performs? Wouldn't the compiler optimize it better than the infinite one because it knows the number of iterations the for loop needs?
- Why infinite loops are... tastyminerals via Digitalmars-d-learn
- Re: Why infinite ... Stanislav Blinov via Digitalmars-d-learn
- Re: Why infinite ... Виталий Фадеев via Digitalmars-d-learn
- Re: Why infinite ... Johan via Digitalmars-d-learn