This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Fix pybench always_display error
Type: Stage:
Components: Benchmarks Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, florin.papa, pitrou, python-dev, vstinner
Priority: normal Keywords: patch

Created on 2015-11-24 12:06 by florin.papa, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fix_pybench_results.patch florin.papa, 2015-11-24 12:32
Messages (5)
msg255262 - (view) Author: Florin Papa (florin.papa) * Date: 2015-11-24 12:06
Hi all,

This is Florin Papa from the Server Languages Optimizations Team at Intel Corporation.

The patch submitted here solves a crash occurring on Python 2.7 after running pybench from perf.py (python perf.py -r -b pybench base_python modified_python). The error appears when trying to display the results of the run because the PyBenchBenchmarkResult class does not include the attribute "always_display".

Here is the error message received:
File "../benchmarks/perf.py", line 2574, in main
    if result.always_display:
AttributeError: 'PyBenchBenchmarkResult' object has no attribute 'always_display'

To apply the patch please follow these steps:

hg clone https://hg.python.org/benchmarks
cd benchmarks/
copy fix_pybench_results.patch to the current directory
hg import --no-commit fix_pybench_results.patch

Thank you,
Florin Papa
msg255330 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-11-25 10:23
Thanks for your bug report.

I fixed the issue differently, by adding a base class to benchmark result classes. I also implemented the format output format for pybench.

By the way, perf.py badly handles errors :-/ CSV output and table output fail to handle errors.

pybench output with my change:
*******************
$ ./perf.py -f -r -b pybench python2.7 python2.7 
(...)

### pybench ###
Min: 285 -> 284: 1.00x faster
Avg: 289 -> 292: 1.01x slower


$ ./perf.py -f --csv=pybench.csv -r -b pybench python2.7 python2.7 
(...)

### pybench ###
Min: 283 -> 286: 1.01x slower
Avg: 287 -> 290: 1.01x slower


$ cat pybench.csv
Benchmark,Base,Changed
pybench,283.000000,286.000000


$ ./perf.py -f -O table -r -b pybench python2.7 python2.7 
(...)
+-----------+-----------+-----------+--------------+
| Benchmark | python2.7 | python2.7 | Change       |
+===========+===========+===========+==============+
| pybench   | 288.0     | 289.0     | 1.00x slower |
+-----------+-----------+-----------+--------------+
*******************
msg255331 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-11-25 10:23
New changeset e77ed7d18a68 by Victor Stinner in branch 'default':
Issue #25721: Fixes for pybench
https://hg.python.org/benchmarks/rev/e77ed7d18a68
msg255332 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-11-25 10:24
Is it ok for you Florin? (Can I close the issue?)
msg255340 - (view) Author: Florin Papa (florin.papa) * Date: 2015-11-25 13:20
Yes, thank you for fixing this.
History
Date User Action Args
2022-04-11 14:58:24adminsetgithub: 69907
2015-11-25 14:21:32vstinnersetstatus: open -> closed
resolution: fixed
2015-11-25 13:20:10florin.papasetmessages: + msg255340
2015-11-25 10:24:19vstinnersetmessages: + msg255332
2015-11-25 10:23:51python-devsetnosy: + python-dev
messages: + msg255331
2015-11-25 10:23:43vstinnersetnosy: + vstinner
messages: + msg255330
2015-11-24 19:24:32brett.cannonsettype: crash ->
2015-11-24 12:32:51florin.papasetfiles: + fix_pybench_results.patch
keywords: + patch
2015-11-24 12:06:54florin.papasettype: crash
2015-11-24 12:06:23florin.papacreate