Hi,

On 31 May 2017 at 17:11, Tuom Larsen <tuom.lar...@gmail.com> wrote:
>             # k = i//j # 2.12 seconds
>             k = int(i/j) # 0.98 seconds

Note first that if you don't do anything with 'k', it might be optimized away.

I just wrote a pure C example doing the same thing, and indeed
converting the integers to float, dividing, and then converting back
to integer... is 2.2x times faster there too.

Go figure it out.  I have no idea why the CPU behaves like that.
Maybe Neal can provide a clue.


A bientôt,

Armin.
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to