Profile на вот этот скрипт:
http://pastebin.com/dgT58pwdOrdered by: cumulative time
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 731.984 731.984 <string>:1(<module>)
1 0.002 0.002 731.984 731.984 {execfile}
1 0.002 0.002 731.983 731.983 test2.py:2(<module>)
1 81.779 81.779 731.981 731.981 test2.py:45(main)
4766057 255.918 0.000 447.373 0.000 test2.py:10(gen_record)
4766056 57.633 0.000 174.220 0.000 {method ‘encode’ of ‘str’ objects}
4766056 68.129 0.000 116.570 0.000 hex_codec.py:13(hex_encode)
25630328 106.164 0.000 106.164 0.000 {len}
16098219 76.919 0.000 76.919 0.000 {method ‘find’ of ‘str’ objects}
4766056 28.530 0.000 28.530 0.000 {method ‘write’ of ‘file’ objects}
4766057 28.516 0.000 28.516 0.000 {method ‘read’ of ‘file’ objects}
4766056 28.297 0.000 28.297 0.000 {binascii.b2a_hex}
2 0.079 0.039 0.079 0.039 {open}
1 0.000 0.000 0.017 0.017 __init__.py:71(search_function)
1 0.016 0.016 0.017 0.017 {__import__}
1 0.001 0.001 0.001 0.001 hex_codec.py:8(<module>)
2 0.000 0.000 0.000 0.000 {built-in method now}
2 0.000 0.000 0.000 0.000 {method ‘close’ of ‘file’ objects}
1 0.000 0.000 0.000 0.000 __init__.py:49(normalize_encoding)
1 0.000 0.000 0.000 0.000 hex_codec.py:70(getregentry)
1 0.000 0.000 0.000 0.000 codecs.py:77(__new__)
3 0.000 0.000 0.000 0.000 {method ‘get’ of ‘dict’ objects}
2 0.000 0.000 0.000 0.000 {isinstance}
1 0.000 0.000 0.000 0.000 {chr}
1 0.000 0.000 0.000 0.000 {method ‘translate’ of ‘str’ objects}
1 0.000 0.000 0.000 0.000 {method ‘split’ of ‘str’ objects}
1 0.000 0.000 0.000 0.000 {method ‘replace’ of ‘str’ objects}
1 0.000 0.000 0.000 0.000 hex_codec.py:45(Codec)
1 0.000 0.000 0.000 0.000 {built-in method __new__ of type object at 0x8149180}
1 0.000 0.000 0.000 0.000 {sys.exit}
1 0.000 0.000 0.000 0.000 hex_codec.py:57(IncrementalDecoder)
1 0.000 0.000 0.000 0.000 {method ‘join’ of ‘str’ objects}
1 0.000 0.000 0.000 0.000 hex_codec.py:62(StreamWriter)
1 0.000 0.000 0.000 0.000 hex_codec.py:52(IncrementalEncoder)
1 0.000 0.000 0.000 0.000 {hasattr}
1 0.000 0.000 0.000 0.000 hex_codec.py:65(StreamReader)
1 0.000 0.000 0.000 0.000 {method ‘disable’ of ‘_lsprof.Profiler’ objects}