Issue21634
Created on 2014-06-02 09:27 by lregebro, last changed 2014-06-02 12:31 by lregebro. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| pystone.diff | lregebro, 2014-06-02 09:27 | review | ||
| pystone12.diff | lregebro, 2014-06-02 09:52 | review | ||
| Messages (8) | |||
|---|---|---|---|
| msg219559 - (view) | Author: Lennart Regebro (lregebro) | Date: 2014-06-02 09:27 | |
Pystone uses some floats in Python 3, while in Python 2 it's all integers. And since it is, as far as I can tell, based on Dhrystone, it should be all ints. After fixing the division in the loop to be a floor division it runs the same as in Python 2. I've verified that after the attached fix the only floats created are time stamps, so this seems to be all that's needed. This also makes the benchmark run c:a 5% faster, lessening the speed difference in pystone between Python 2 and Python 3, which contributes to the misconception that Python 3 is horribly slow. |
|||
| msg219560 - (view) | Author: STINNER Victor (vstinner) * | Date: 2014-06-02 09:30 | |
According to the name of variables ("IntLoc2 = IntLoc3 // IntLoc1"), I agree that integers should be used. Since the performances can be different between int and float, you should change the version and explain your change in the changelog (in the top docstring).
|
|||
| msg219563 - (view) | Author: Lennart Regebro (lregebro) | Date: 2014-06-02 09:52 | |
Yes, good point, I added this in a new diff. |
|||
| msg219570 - (view) | Author: STINNER Victor (vstinner) * | Date: 2014-06-02 12:05 | |
+ Unde Python 3 version 1.1 would use the normal division I guess that it's a typo: "Under Python 3 ..."? |
|||
| msg219571 - (view) | Author: Lennart Regebro (lregebro) | Date: 2014-06-02 12:06 | |
Oups, yes, that's a typo. |
|||
| msg219573 - (view) | Author: Roundup Robot (python-dev) | Date: 2014-06-02 12:18 | |
New changeset 1318324aa93a by Victor Stinner in branch '3.4': Issue #21634: Fix pystone micro-benchmark: use floor division instead of true http://hg.python.org/cpython/rev/1318324aa93a New changeset 95b7acdc0f24 by Victor Stinner in branch 'default': (Merge 3.4) Issue #21634: Fix pystone micro-benchmark: use floor division http://hg.python.org/cpython/rev/95b7acdc0f24 |
|||
| msg219574 - (view) | Author: STINNER Victor (vstinner) * | Date: 2014-06-02 12:19 | |
Thanks the patch, I fixed pystone in Python 3.4 and 3.5. |
|||
| msg219577 - (view) | Author: Lennart Regebro (lregebro) | Date: 2014-06-02 12:31 | |
Awesome, thanks! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2014-06-02 12:31:53 | lregebro | set | messages: + msg219577 |
| 2014-06-02 12:19:38 | vstinner | set | status: open -> closed resolution: fixed messages: + msg219574 versions: - Python 3.1, Python 3.2, Python 3.3 |
| 2014-06-02 12:18:26 | python-dev | set | nosy:
+ python-dev messages: + msg219573 |
| 2014-06-02 12:06:16 | lregebro | set | messages: + msg219571 |
| 2014-06-02 12:05:19 | vstinner | set | messages: + msg219570 |
| 2014-06-02 09:52:19 | lregebro | set | files:
+ pystone12.diff messages: + msg219563 |
| 2014-06-02 09:30:08 | vstinner | set | nosy:
+ vstinner messages: + msg219560 |
| 2014-06-02 09:27:08 | lregebro | create | |