python / pyperformance

Python Performance Benchmark Suite
http://pyperformance.readthedocs.io/
MIT License
870 stars 175 forks source link

Add `list.sort` benchmarks #328

Closed sobolevn closed 9 months ago

sobolevn commented 9 months ago

As requested in https://github.com/python/cpython/pull/114687 by @corona10 I ported this script into pyperformance.

Changes:

  1. Now we have new sorting group
  2. All previous cases were translated into a separate benchmark (they are different only by the input data)
corona10 commented 9 months ago

@gvanrossum Do you think that it is okay to relocate list.sort benchmark in here?

sobolevn commented 9 months ago

This still happens:

[40/88] list_sort_ascending_exchanged...
# /home/runner/work/pyperformance/pyperformance/venv/cpython3.11-3c206e65878c-compat-3c0fde653f89/bin/python -u /home/runner/work/pyperformance/pyperformance/pyperformance/data-files/benchmarks/bm_list_sort/run_benchmark.py list_sort_ascending_exchanged --debug-single-value --output /tmp/tmphqhu0yau --inherit-environ PYPERFORMANCE_RUNID
.
WARNING: the benchmark result may be unstable
* the shortest raw value is only 285 us

Try to rerun the benchmark with more runs, values and/or loops.
Run 'python -m pyperf system tune' command to reduce the system jitter.
Use pyperf stats, pyperf dump and pyperf hist to analyze results.
Use --quiet option to hide these warnings.
sobolevn commented 9 months ago

WARNING: the benchmark result may be unstable is gone!

gvanrossum commented 9 months ago

@gvanrossum Do you think that it is okay to relocate list.sort benchmark in here?

My response is the same as for the decimal benchmark: moving this benchmark here is not going to help us speed up the Python interpreter, it will just make it harder for us to show any improvements. Maybe put this benchmark in Tools/scripts?

sobolevn commented 9 months ago

Maybe put this benchmark in Tools/scripts?

Sounds good to me! 👍