Skip to content

Instantly share code, notes, and snippets.

@jeethu
Created January 17, 2018 00:55
Show Gist options
  • Save jeethu/19430d802aa08e28d1cb5eb20a47a470 to your computer and use it in GitHub Desktop.
Save jeethu/19430d802aa08e28d1cb5eb20a47a470 to your computer and use it in GitHub Desktop.
perf timeit comparison Raw
jeethu@Odin:~/Projects/cpython$ # Baseline
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=[]' $(python3 -c 'print("l.insert(0, None); " * 100 + "l.clear();")') --duplicate 100
.....................
WARNING: the benchmark result may be unstable
* the standard deviation (1.37 us) is 13% of the mean (10.5 us)
Try to rerun the benchmark with more runs, values and/or loops.
Run 'python3 -m perf system tune' command to reduce the system jitter.
Use perf stats, perf dump and perf hist to analyze results.
Use --quiet option to hide these warnings.
Mean +- std dev: 10.5 us +- 1.4 us
jeethu@Odin:~/Projects/cpython$ # py37_list_insert_memmove
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=[]' $(python3 -c 'print("l.insert(0, None); " * 100 + "l.clear();")') --duplicate 100
.....................
Mean +- std dev: 9.68 us +- 0.89 us
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment