Message288818
> The purpose of the issue is unclear to me.
I was asked to open an issue by Serhiy Storchaka on the GitHub PR.
> Why do you want to replace while with for? For readability?
Yes, I have open a PR just to improve the readability, because I was surprised by this incrementing-decrementing statements like you.
> You should ask Raymond Hettinger for the rationale. The commit message says "better generated code (on both GCC and CLang)", but there is no benchmark nor any data to validate this.
The purpose is clear to me - to eliminate postincrement and temporary variable that it requires.
> Nowadays, C compilers are very smart and implement crazy optimizations. Python releases are compiled using PGO, or even PGO+LTO. Please compile your benchmark using PGO. I expect that compilers emit the same machine code at the end for "while" and "for" loops.
> The question is also if your benchmark is revelant for the _collections module.
> What should I see in your benchmark? I see that results are the same for while and for_loop except a minor noise in the benchmark.
Benchmark was made to show that location of cmp+jmp location (look at asm output for more info) makes no sense to performance.
Actually I do not want to spend more time on a such minor change. |
|
Date |
User |
Action |
Args |
2017-03-02 17:28:17 | Kojoley | set | recipients:
+ Kojoley, rhettinger, vstinner, serhiy.storchaka |
2017-03-02 17:28:17 | Kojoley | set | messageid: <1488475697.8.0.935554655235.issue29698@psf.upfronthosting.co.za> |
2017-03-02 17:28:17 | Kojoley | link | issue29698 messages |
2017-03-02 17:28:17 | Kojoley | create | |
|