Skip to content

Instantly share code, notes, and snippets.

@jeethu
Created January 17, 2018 00:04
Show Gist options
  • Save jeethu/2d2de55afdb8ea4ad03b6a5d04d5227f to your computer and use it in GitHub Desktop.
Save jeethu/2d2de55afdb8ea4ad03b6a5d04d5227f to your computer and use it in GitHub Desktop.
perf timeit comparison
jeethu@Odin:~/Projects/cpython$ # Baseline
jeethu@Odin:~/Projects/cpython$ ~/Projects/cpython/venv/cpython3.7-487fa3ea092b/bin/python -c "import sys;print(sys.version)"
3.7.0a4+ (heads/master:9f1b7b93f5, Jan 16 2018, 19:15:03)
[GCC 7.2.0]
jeethu@Odin:~/Projects/cpython$ taskset -c 2,3,6,7 python3 -m perf timeit --python=~/Projects/cpython/venv/cpython3.7-487fa3ea092b/bin/python -s 'l=[];ins=l.insert' $(python3 -c 'print("ins(0, None); " * 100 + "l.clear();")') --duplicate 100
.....................
Mean +- std dev: 6.55 us +- 0.03 us
jeethu@Odin:~/Projects/cpython$ # py37_list_insert_memmove
jeethu@Odin:~/Projects/cpython$ ~/Projects/cpython/venv/cpython3.7-6f97bfe96b63/bin/python -c "import sys;print(sys.version)"
3.7.0a4+ (heads/py37_list_insert_memmove:16b236d958, Jan 16 2018, 22:00:56)
jeethu@Odin:~/Projects/cpython$ taskset -c 2,3,6,7 python3 -m perf timeit --python=~/Projects/cpython/venv/cpython3.7-6f97bfe96b63/bin/python -s 'l=[];ins=l.insert' $(python3 -c 'print("ins(0, None); " * 100 + "l.clear();")') --duplicate 100
.....................
Mean +- std dev: 5.44 us +- 0.07 us
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment