Skip to content

Instantly share code, notes, and snippets.

@nekoya
Created March 13, 2014 03:44
Show Gist options
  • Save nekoya/9521587 to your computer and use it in GitHub Desktop.
Save nekoya/9521587 to your computer and use it in GitHub Desktop.
from benchmarker import Benchmarker
import collections
with Benchmarker(width=40, loop=100000) as bm:
for _ in bm('empty dict'):
collections.Counter({})
for _ in bm('none'):
collections.Counter()
"""
## benchmarker: release 3.0.1 (for python)
## python platform: linux2 [GCC 4.6.3]
## python version: 2.7.3
## python executable: /kauli/common/python27/bin/python
## user sys total real
empty dict 0.2400 0.0000 0.2400 0.2441
none 0.0800 0.0000 0.0800 0.0743
## Ranking real
none 0.0743 (100.0%) *************************
empty dict 0.2441 ( 30.4%) ********
## Ratio Matrix real [01] [02]
[01] none 0.0743 100.0% 328.6%
[02] empty dict 0.2441 30.4% 100.0%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment