Skip to content

Conversation

@rhettinger
Copy link
Contributor

Timings with patch:

$ ./python.exe -m timeit -r11 -s 'from collections import deque' 'deque()'
5000000 loops, best of 11: 77.2 nsec per loop
$ ./python.exe -m timeit -r11 -s 'from collections import deque' 'deque("abc")'
2000000 loops, best of 11: 157 nsec per loop
$ ./python.exe -m timeit -r11 -s 'from collections import deque' 'deque("abc", 2)'
2000000 loops, best of 11: 166 nsec per loop

Baseline timings:

$ ./python.exe -m timeit -r11 -s 'from collections import deque' 'deque()'
5000000 loops, best of 11: 81.4 nsec per loop
$ ./python.exe -m timeit -r11 -s 'from collections import deque' 'deque("abc")'
2000000 loops, best of 11: 171 nsec per loop
$ ./python.exe -m timeit -r11 -s 'from collections import deque' 'deque("abc", 2)'
2000000 loops, best of 11: 181 nsec per loop

@rhettinger rhettinger added performance Performance or resource usage skip issue skip news labels Feb 1, 2019
@rhettinger rhettinger merged commit 05f1b93 into python:master Feb 1, 2019
@rhettinger rhettinger deleted the deque-init-opt branch February 1, 2019 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Performance or resource usage skip issue skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants