Skip to content

Instantly share code, notes, and snippets.

@jtratner
Created June 5, 2012 16:46
Show Gist options
  • Save jtratner/2876174 to your computer and use it in GitHub Desktop.
Save jtratner/2876174 to your computer and use it in GitHub Desktop.
Comparing portmanteau
My answer:
8588 function calls in 0.015 CPU seconds
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.015 0.015 <string>:1(<module>)
1 0.000 0.000 0.000 0.000 __future__.py:48(<module>)
1 0.000 0.000 0.000 0.000 __future__.py:74(_Feature)
7 0.000 0.000 0.000 0.000 __future__.py:75(__init__)
49 0.004 0.000 0.010 0.000 portmanteau.py:103(natalie)
17 0.000 0.000 0.000 0.000 portmanteau.py:124(eq_)
1 0.000 0.000 0.003 0.003 portmanteau.py:132(test_natalie1)
1 0.000 0.000 0.007 0.007 portmanteau.py:195(test_natalie2)
1 0.001 0.001 0.011 0.011 portmanteau.py:2(<module>)
269 0.001 0.000 0.001 0.000 portmanteau.py:66(make_port)
270 0.003 0.000 0.004 0.000 portmanteau.py:76(break_up_word)
269 0.000 0.000 0.001 0.000 portmanteau.py:89(calculate_score)
269 0.000 0.000 0.000 0.000 portmanteau.py:97(sort_ports)
807 0.000 0.000 0.000 0.000 {abs}
1 0.003 0.003 0.015 0.015 {execfile}
1346 0.000 0.000 0.000 0.000 {len}
3878 0.001 0.000 0.001 0.000 {method 'add' of 'set' objects}
1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}
1080 0.000 0.000 0.000 0.000 {method 'discard' of 'set' objects}
270 0.000 0.000 0.000 0.000 {range}
49 0.000 0.000 0.001 0.000 {sorted}
"Official answer"
4882 function calls in 0.016 CPU seconds
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.016 0.016 <string>:1(<module>)
1 0.004 0.004 0.004 0.004 collections.py:1(<module>)
1 0.000 0.000 0.000 0.000 keyword.py:11(<module>)
49 0.002 0.000 0.007 0.000 portmanteau_official_answer.py:11(alltriples)
1 0.000 0.000 0.005 0.005 portmanteau_official_answer.py:114(test_natalie2)
1 0.001 0.001 0.013 0.013 portmanteau_official_answer.py:2(<module>)
540 0.002 0.000 0.003 0.000 portmanteau_official_answer.py:26(splits)
49 0.002 0.000 0.004 0.000 portmanteau_official_answer.py:30(compute_ends)
269 0.001 0.000 0.001 0.000 portmanteau_official_answer.py:38(portman_score)
49 0.001 0.000 0.009 0.000 portmanteau_official_answer.py:4(natalie)
17 0.000 0.000 0.000 0.000 portmanteau_official_answer.py:43(eq_)
1 0.000 0.000 0.004 0.004 portmanteau_official_answer.py:51(test_natalie1)
807 0.000 0.000 0.000 0.000 {abs}
1 0.003 0.003 0.016 0.016 {execfile}
540 0.000 0.000 0.000 0.000 {len}
269 0.000 0.000 0.000 0.000 {map}
37 0.000 0.000 0.001 0.000 {max}
1671 0.000 0.000 0.000 0.000 {method 'append' of 'list' objects}
1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}
37 0.000 0.000 0.000 0.000 {method 'join' of 'str' objects}
540 0.001 0.000 0.001 0.000 {range}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment