Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pavdmyt/sort_test
Performance tests for different sorting algorithms.
https://github.com/pavdmyt/sort_test
Last synced: 6 days ago
JSON representation
Performance tests for different sorting algorithms.
- Host: GitHub
- URL: https://github.com/pavdmyt/sort_test
- Owner: pavdmyt
- Created: 2015-01-28T21:09:53.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-30T19:56:21.000Z (almost 10 years ago)
- Last Synced: 2023-04-09T22:11:44.064Z (over 1 year ago)
- Language: Python
- Size: 125 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
Sorting algorithms performance test
===================================For each sorting algorithm the measurement suite is running seven times
keeping only the best time (this reduces measurement distortions due to
other processes running on the system). Measurement suite consists of 100
algorithm launches.Methodology of testing is borrowed from *Raymond Hettinger's* response_
at stackoverflow_.Results below represent times best measurement suite took, in seconds.
Example and results
-------------------::
# Python 2.7.6 results
$ python sortalgs_timeit.py
bubble_sort
14.6841878891insertion_sort
10.7499198914selection_sort
5.76975679398merge_sort
0.808687925339quick_sort
0.533707141876heap_sort
0.386697053909radix_sort
0.253129005432# Python 3.4.0 results
$ python3 sortalgs_timeit.py
bubble_sort
18.041432760001044insertion_sort
15.274030503001995selection_sort
8.200087869990966merge_sort
0.9270278659969335quick_sort
0.6184024200047133heap_sort
0.06310781999491155radix_sort
0.5277346099901479.. _response: http://stackoverflow.com/questions/8220801/how-to-use-timeit-module/8220943#8220943
.. _stackoverflow: http://stackoverflow.com/