I have seen it being used a lot in the documentation and I just wanted to know if this is well-known.
Loops using ranges are only about half as performant as loops written with a while and a counting variable, you can see this here.
EDIT: as the first reply suggests the above statement is wrong
Now I have a few questions and suggestions:
- is there anything even faster?
- optimizing for loops
- are there plans?
- is it possible?
- are there reasons why it is used in the docs, other than readability?
- should it be replaced?
- or at least mention it so people use while if their application needs performance