On Tue, May 5, 2015 at 12:45 PM, Dave Angel <da...@davea.name> wrote: > When the "simple" is True, the function takes noticeably and consistently > longer. For example, it might take 116 instead of 109 seconds. For the > same counts, your code took 111.
I can't replicate this. What version of Python is it, and what value of x are you testing with? > I've looked at dis.dis(factorial_iterative), and can see no explicit reason > for the difference. My first thought is that maybe it's a result of the branch. Have you tried swapping the branches, or reimplementing as separate functions and comparing? -- https://mail.python.org/mailman/listinfo/python-list