Skip to content

Commit

Permalink
Changes for Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
grantjenks committed Nov 22, 2018
1 parent c8f1e1d commit 5ca6235
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 24 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ matrix:
env: TOXENV=py35
- python: 3.6
env: TOXENV=py36
- python: 3.7
dist: xenial
env: TOXENV=py37
- python: pypy
env: TOXENV=pypy
- python: pypy3
env: TOXENV=pypy3
- python: 3.6
- python: 3.7
dist: xenial
env: TOXENV=lint
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ Features
- Compatible API (nearly identical to older blist and bintrees modules)
- Feature-rich (e.g. get the five largest keys in a sorted dict: d.keys()[-5:])
- Pragmatic design (e.g. SortedSet is a Python set with a SortedList index)
- Developed on Python 3.6
- Tested on CPython 2.7, 3.2, 3.3, 3.4, 3.5, 3.6 and PyPy, PyPy3
- Developed on Python 3.7
- Tested on CPython 2.7, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 and PyPy, PyPy3

.. image:: https://api.travis-ci.org/grantjenks/python-sortedcontainers.svg?branch=master
:target: http://www.grantjenks.com/docs/sortedcontainers/
Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ environment:
- PYTHON: "C:\\Python34"
- PYTHON: "C:\\Python35"
- PYTHON: "C:\\Python36"
- PYTHON: "C:\\Python37"
- PYTHON: "C:\\Python27-x64"
- PYTHON: "C:\\Python34-x64"
- PYTHON: "C:\\Python35-x64"
- PYTHON: "C:\\Python36-x64"
- PYTHON: "C:\\Python37-x64"

install:

Expand Down
1 change: 1 addition & 0 deletions docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ of Python:
* CPython 3.4
* CPython 3.5
* CPython 3.6
* CPython 3.7
* PyPy
* PyPy3

Expand Down
2 changes: 1 addition & 1 deletion docs/performance-load.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ in-depth analysis of the load factor read :doc:`Performance at
Scale<performance-scale>`.

Performance of competing implementations are benchmarked against the CPython
3.6 runtime. An :doc:`implementation performance comparison<performance>` is
3.7 runtime. An :doc:`implementation performance comparison<performance>` is
also included with data from popular sorted collections packages.

Because :doc:`Sorted Containers<index>` is pure-Python, its performance also
Expand Down
8 changes: 4 additions & 4 deletions docs/performance-runtime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ Runtime Performance Comparison
Because :doc:`Sorted Containers<index>` is implemented in pure-Python, its
performance depends directly on the Python runtime. :doc:`Sorted
Containers<index>` is primarily developed, tested and benchmarked on CPython
3.6.
3.7.

Not all runtimes are created equal. The graphs below compare :doc:`Sorted
Containers<index>` running on the CPython 3.6, CPython 2.7, and PyPy
runtimes. As of Python 3.6 the CPython 3.6 runtime is now faster than the
Containers<index>` running on the CPython 3.7, CPython 2.7, and PyPy
runtimes. As of Python 3.7 the CPython 3.7 runtime is now faster than the
CPython 2.7 runtime. The PyPy runtime displays much more variability due to its
JIT-ed nature. Once the just-in-time compiler optimizes the code, performance
is often two to ten times faster.

Performance of competing implementations are benchmarked against the CPython
3.6 runtime. An :doc:`implementation performance comparison<performance>` is
3.7 runtime. An :doc:`implementation performance comparison<performance>` is
also included with data from popular sorted container packages.

:doc:`Sorted Containers<index>` uses a segmented-list data structure similar to
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def run_tests(self):
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
),
Expand Down
30 changes: 15 additions & 15 deletions tests/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,51 @@ set -x

# Compare Implementations

echo ". env36/bin/activate && python -m tests.benchmark_sortedlist --bare > tests/results_sortedlist.txt" | bash
echo ". env37/bin/activate && python -m tests.benchmark_sortedlist --bare > tests/results_sortedlist.txt" | bash
python -m tests.benchmark_plot tests/results_sortedlist.txt SortedList --save

echo ". env36/bin/activate && python -m tests.benchmark_sorteddict --bare > tests/results_sorteddict.txt" | bash
echo ". env37/bin/activate && python -m tests.benchmark_sorteddict --bare > tests/results_sorteddict.txt" | bash
python -m tests.benchmark_plot tests/results_sorteddict.txt SortedDict --save

echo ". env36/bin/activate && python -m tests.benchmark_sortedset --bare > tests/results_sortedset.txt" | bash
echo ". env37/bin/activate && python -m tests.benchmark_sortedset --bare > tests/results_sortedset.txt" | bash
python -m tests.benchmark_plot tests/results_sortedset.txt SortedSet --save

# Compare Python Versions

rm tests/results_runtime_sortedlist.txt
echo ". env36/bin/activate && python -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _Py36 >> tests/results_runtime_sortedlist.txt" | bash
echo ". env37/bin/activate && python -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _Py37 >> tests/results_runtime_sortedlist.txt" | bash
echo ". env27/bin/activate && python -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _Py27 >> tests/results_runtime_sortedlist.txt" | bash
echo ". env27/bin/activate && pypy -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _PyPy >> tests/results_runtime_sortedlist.txt" | bash
python -m tests.benchmark_plot tests/results_runtime_sortedlist.txt SortedList --suffix _runtime --save

rm tests/results_runtime_sorteddict.txt
echo ". env36/bin/activate && python -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _Py36 >> tests/results_runtime_sorteddict.txt" | bash
echo ". env37/bin/activate && python -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _Py37 >> tests/results_runtime_sorteddict.txt" | bash
echo ". env27/bin/activate && python -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _Py27 >> tests/results_runtime_sorteddict.txt" | bash
echo ". env27/bin/activate && pypy -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _PyPy >> tests/results_runtime_sorteddict.txt" | bash
python -m tests.benchmark_plot tests/results_runtime_sorteddict.txt SortedDict --suffix _runtime --save

rm tests/results_runtime_sortedset.txt
echo ". env36/bin/activate && python -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _Py36 >> tests/results_runtime_sortedset.txt" | bash
echo ". env37/bin/activate && python -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _Py37 >> tests/results_runtime_sortedset.txt" | bash
echo ". env27/bin/activate && python -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _Py27 >> tests/results_runtime_sortedset.txt" | bash
echo ". env27/bin/activate && pypy -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _PyPy >> tests/results_runtime_sortedset.txt" | bash
python -m tests.benchmark_plot tests/results_runtime_sortedset.txt SortedSet --suffix _runtime --save

# Compare Loads

rm tests/results_load_sortedlist.txt
echo ". env36/bin/activate && python -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _100 --load 100 --no-limit >> tests/results_load_sortedlist.txt" | bash
echo ". env36/bin/activate && python -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _1000 --load 1000 --no-limit >> tests/results_load_sortedlist.txt" | bash
echo ". env36/bin/activate && python -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _10000 --load 10000 --no-limit >> tests/results_load_sortedlist.txt" | bash
echo ". env37/bin/activate && python -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _100 --load 100 --no-limit >> tests/results_load_sortedlist.txt" | bash
echo ". env37/bin/activate && python -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _1000 --load 1000 --no-limit >> tests/results_load_sortedlist.txt" | bash
echo ". env37/bin/activate && python -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _10000 --load 10000 --no-limit >> tests/results_load_sortedlist.txt" | bash
python -m tests.benchmark_plot tests/results_load_sortedlist.txt SortedList --suffix _load --save

rm tests/results_load_sorteddict.txt
echo ". env36/bin/activate && python -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _100 --load 100 --no-limit >> tests/results_load_sorteddict.txt" | bash
echo ". env36/bin/activate && python -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _1000 --load 1000 --no-limit >> tests/results_load_sorteddict.txt" | bash
echo ". env36/bin/activate && python -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _10000 --load 10000 --no-limit >> tests/results_load_sorteddict.txt" | bash
echo ". env37/bin/activate && python -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _100 --load 100 --no-limit >> tests/results_load_sorteddict.txt" | bash
echo ". env37/bin/activate && python -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _1000 --load 1000 --no-limit >> tests/results_load_sorteddict.txt" | bash
echo ". env37/bin/activate && python -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _10000 --load 10000 --no-limit >> tests/results_load_sorteddict.txt" | bash
python -m tests.benchmark_plot tests/results_load_sorteddict.txt SortedDict --suffix _load --save

rm tests/results_load_sortedset.txt
echo ". env36/bin/activate && python -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _100 --load 100 --no-limit >> tests/results_load_sortedset.txt" | bash
echo ". env36/bin/activate && python -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _1000 --load 1000 --no-limit >> tests/results_load_sortedset.txt" | bash
echo ". env36/bin/activate && python -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _10000 --load 10000 --no-limit >> tests/results_load_sortedset.txt" | bash
echo ". env37/bin/activate && python -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _100 --load 100 --no-limit >> tests/results_load_sortedset.txt" | bash
echo ". env37/bin/activate && python -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _1000 --load 1000 --no-limit >> tests/results_load_sortedset.txt" | bash
echo ". env37/bin/activate && python -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _10000 --load 10000 --no-limit >> tests/results_load_sortedset.txt" | bash
python -m tests.benchmark_plot tests/results_load_sortedset.txt SortedSet --suffix _load --save
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist=py27,py34,py35,py36,pypy,pypy3,lint
envlist=py27,py34,py35,py36,py37,pypy,pypy3,lint
skip_missing_interpreters=True

[testenv]
Expand Down

0 comments on commit 5ca6235

Please sign in to comment.