Skip to content

Instantly share code, notes, and snippets.

@schlamar
Last active December 22, 2015 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schlamar/6388947 to your computer and use it in GitHub Desktop.
Save schlamar/6388947 to your computer and use it in GitHub Desktop.
Tulip benchmark profiled
$ /c/Python33/python bench.py
858 function calls in 0.130 seconds
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.130 0.130 <string>:1(<module>)
24 0.000 0.000 0.000 0.000 __init__.py:1284(log)
24 0.000 0.000 0.000 0.000 __init__.py:1453(getEffectiveLevel)
24 0.000 0.000 0.000 0.000 __init__.py:1467(isEnabledFor)
1 0.000 0.000 0.130 0.130 base_events.py:101(run_forever)
1 0.000 0.000 0.130 0.130 base_events.py:115(run_until_complete)
94 0.000 0.000 0.000 0.000 base_events.py:167(time)
9 0.000 0.000 0.000 0.000 base_events.py:171(call_later)
9 0.000 0.000 0.000 0.000 base_events.py:189(call_at)
11 0.000 0.000 0.000 0.000 base_events.py:195(call_soon)
1 0.000 0.000 0.000 0.000 base_events.py:44(_raise_stop_error)
24 0.001 0.000 0.130 0.005 base_events.py:556(_run_once)
6 0.000 0.000 0.000 0.000 bench.py:14(sub_sub)
10 0.000 0.000 0.000 0.000 bench.py:20(sub)
10 0.000 0.000 0.000 0.000 bench.py:27(main)
1 0.000 0.000 0.130 0.130 bench.py:34(bench)
9 0.000 0.000 0.000 0.000 bench.py:8(async_func)
20 0.000 0.000 0.000 0.000 events.py:24(__init__)
9 0.000 0.000 0.000 0.000 events.py:323(get_event_loop)
9 0.000 0.000 0.000 0.000 events.py:365(get_event_loop_policy)
20 0.000 0.000 0.001 0.000 events.py:38(_run)
9 0.000 0.000 0.000 0.000 events.py:381(get_event_loop)
11 0.000 0.000 0.000 0.000 events.py:47(make_handle)
9 0.000 0.000 0.000 0.000 events.py:56(__init__)
10 0.000 0.000 0.000 0.000 futures.py:140(__init__)
10 0.000 0.000 0.000 0.000 futures.py:197(_schedule_callbacks)
29 0.000 0.000 0.000 0.000 futures.py:222(done)
19 0.000 0.000 0.000 0.000 futures.py:230(result)
10 0.000 0.000 0.000 0.000 futures.py:265(add_done_callback)
1 0.000 0.000 0.000 0.000 futures.py:279(remove_done_callback)
1 0.000 0.000 0.000 0.000 futures.py:284(<listcomp>)
10 0.000 0.000 0.000 0.000 futures.py:292(set_result)
18 0.000 0.000 0.000 0.000 futures.py:339(__iter__)
2 0.000 0.000 0.000 0.000 inspect.py:184(isgenerator)
24 0.000 0.000 0.000 0.000 selector_events.py:300(_process_events)
24 0.000 0.000 0.128 0.005 selectors.py:227(select)
24 0.000 0.000 0.128 0.005 selectors.py:249(_select)
10 0.000 0.000 0.000 0.000 tasks.py:114(_step)
9 0.000 0.000 0.000 0.000 tasks.py:183(_wakeup)
1 0.000 0.000 0.000 0.000 tasks.py:344(async)
1 0.000 0.000 0.000 0.000 tasks.py:47(iscoroutine)
1 0.000 0.000 0.000 0.000 tasks.py:75(__init__)
1 0.000 0.000 0.130 0.130 {built-in method exec}
9 0.000 0.000 0.000 0.000 {built-in method heappop}
9 0.000 0.000 0.000 0.000 {built-in method heappush}
47 0.000 0.000 0.000 0.000 {built-in method isinstance}
26 0.000 0.000 0.000 0.000 {built-in method len}
13 0.000 0.000 0.000 0.000 {built-in method max}
94 0.000 0.000 0.000 0.000 {built-in method monotonic}
1 0.000 0.000 0.000 0.000 {built-in method next}
24 0.128 0.005 0.128 0.005 {built-in method select}
20 0.000 0.000 0.000 0.000 {method 'append' of 'collections.deque' objects}
10 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}
24 0.000 0.000 0.000 0.000 {method 'format' of 'str' objects}
20 0.000 0.000 0.000 0.000 {method 'popleft' of 'collections.deque' objects}
9 0.000 0.000 0.000 0.000 {method 'send' of 'generator' objects}
$ /c/Python33/python bench_torn.py
697 function calls in 0.090 seconds
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.090 0.090 <string>:1(<module>)
1 0.000 0.000 0.000 0.000 __init__.py:1379(addHandler)
1 0.000 0.000 0.000 0.000 __init__.py:1631(basicConfig)
1 0.000 0.000 0.000 0.000 __init__.py:171(_checkLevel)
1 0.000 0.000 0.000 0.000 __init__.py:1723(getLogger)
3 0.000 0.000 0.000 0.000 __init__.py:200(_acquireLock)
3 0.000 0.000 0.000 0.000 __init__.py:209(_releaseLock)
1 0.000 0.000 0.000 0.000 __init__.py:357(__init__)
1 0.000 0.000 0.000 0.000 __init__.py:441(__init__)
1 0.000 0.000 0.000 0.000 __init__.py:654(__init__)
1 0.000 0.000 0.000 0.000 __init__.py:720(_addHandlerRef)
1 0.000 0.000 0.000 0.000 __init__.py:739(__init__)
1 0.000 0.000 0.000 0.000 __init__.py:768(createLock)
1 0.000 0.000 0.000 0.000 __init__.py:838(setFormatter)
1 0.000 0.000 0.000 0.000 __init__.py:903(__init__)
1 0.000 0.000 0.000 0.000 _weakrefset.py:16(__init__)
1 0.000 0.000 0.000 0.000 _weakrefset.py:20(__enter__)
1 0.000 0.000 0.000 0.000 _weakrefset.py:26(__exit__)
1 0.000 0.000 0.000 0.000 _weakrefset.py:36(__init__)
1 0.000 0.000 0.000 0.000 _weakrefset.py:52(_commit_removals)
2 0.000 0.000 0.000 0.000 _weakrefset.py:58(__iter__)
10 0.000 0.000 0.000 0.000 _weakrefset.py:68(__contains__)
1 0.000 0.000 0.000 0.000 _weakrefset.py:79(add)
9 0.000 0.000 0.000 0.000 abc.py:175(__instancecheck__)
1 0.000 0.000 0.000 0.000 abc.py:191(__subclasscheck__)
9 0.000 0.000 0.000 0.000 bench_torn.py:10(async_func)
6 0.000 0.000 0.000 0.000 bench_torn.py:16(sub_sub)
10 0.000 0.000 0.000 0.000 bench_torn.py:22(sub)
10 0.000 0.000 0.000 0.000 bench_torn.py:29(main)
1 0.000 0.000 0.090 0.090 bench_torn.py:36(bench)
2 0.000 0.000 0.000 0.000 common.py:74(wake)
1 0.000 0.000 0.000 0.000 common.py:80(consume)
10 0.000 0.000 0.000 0.000 events.py:323(get_event_loop)
10 0.000 0.000 0.000 0.000 events.py:365(get_event_loop_policy)
10 0.000 0.000 0.000 0.000 events.py:381(get_event_loop)
1 0.000 0.000 0.000 0.000 functools.py:35(update_wrapper)
1 0.000 0.000 0.000 0.000 functools.py:63(wraps)
10 0.000 0.000 0.000 0.000 futures.py:140(__init__)
10 0.000 0.000 0.000 0.000 futures.py:197(_schedule_callbacks)
28 0.000 0.000 0.000 0.000 futures.py:222(done)
18 0.000 0.000 0.000 0.000 futures.py:230(result)
10 0.000 0.000 0.000 0.000 futures.py:265(add_done_callback)
10 0.000 0.000 0.000 0.000 futures.py:292(set_result)
18 0.000 0.000 0.000 0.000 futures.py:339(__iter__)
1 0.000 0.000 0.000 0.000 inspect.py:184(isgenerator)
20 0.000 0.000 0.001 0.000 ioloop.py:452(_run_callback)
1 0.000 0.000 0.000 0.000 ioloop.py:504(<lambda>)
1 0.000 0.000 0.090 0.090 ioloop.py:549(start)
1 0.000 0.000 0.000 0.000 ioloop.py:691(stop)
28 0.000 0.000 0.000 0.000 ioloop.py:696(time)
9 0.000 0.000 0.000 0.000 ioloop.py:699(add_timeout)
11 0.000 0.000 0.000 0.000 ioloop.py:713(add_callback)
9 0.000 0.000 0.000 0.000 ioloop.py:754(__init__)
20 0.000 0.000 0.088 0.004 select.py:61(poll)
21 0.000 0.000 0.000 0.000 stack_context.py:227(_remove_deactivated)
21 0.000 0.000 0.000 0.000 stack_context.py:230(<listcomp>)
20 0.000 0.000 0.000 0.000 stack_context.py:253(wrap)
21 0.000 0.000 0.001 0.000 stack_context.py:269(wrapped)
10 0.000 0.000 0.000 0.000 tasks.py:114(_step)
9 0.000 0.000 0.000 0.000 tasks.py:183(_wakeup)
1 0.000 0.000 0.000 0.000 tasks.py:63(task_wrapper)
1 0.000 0.000 0.000 0.000 tasks.py:75(__init__)
1 0.000 0.000 0.000 0.000 threading.py:58(RLock)
1 0.000 0.000 0.000 0.000 tornloop.py:12(ignore_args)
1 0.000 0.000 0.000 0.000 tornloop.py:13(wrapper)
1 0.000 0.000 0.090 0.090 tornloop.py:23(run_forever)
1 0.000 0.000 0.090 0.090 tornloop.py:26(run_until_complete)
1 0.000 0.000 0.000 0.000 tornloop.py:30(stop)
11 0.000 0.000 0.000 0.000 tornloop.py:33(call_soon)
9 0.000 0.000 0.000 0.000 tornloop.py:36(call_later)
1 0.000 0.000 0.090 0.090 {built-in method exec}
12 0.000 0.000 0.000 0.000 {built-in method get_ident}
9 0.000 0.000 0.000 0.000 {built-in method getattr}
21 0.000 0.000 0.000 0.000 {built-in method hasattr}
9 0.000 0.000 0.000 0.000 {built-in method heappop}
9 0.000 0.000 0.000 0.000 {built-in method heappush}
20 0.000 0.000 0.000 0.000 {built-in method isinstance}
1 0.000 0.000 0.000 0.000 {built-in method issubclass}
1 0.000 0.000 0.000 0.000 {built-in method len}
10 0.000 0.000 0.000 0.000 {built-in method min}
1 0.000 0.000 0.000 0.000 {built-in method next}
20 0.088 0.004 0.088 0.004 {built-in method select}
5 0.000 0.000 0.000 0.000 {built-in method setattr}
28 0.000 0.000 0.000 0.000 {built-in method time}
1 0.000 0.000 0.000 0.000 {method '__subclasshook__' of 'object' objects}
3 0.000 0.000 0.000 0.000 {method 'acquire' of '_thread.RLock' objects}
2 0.000 0.000 0.000 0.000 {method 'add' of 'set' objects}
23 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}
8 0.000 0.000 0.000 0.000 {method 'get' of 'dict' objects}
20 0.000 0.000 0.000 0.000 {method 'items' of 'dict' objects}
1 0.000 0.000 0.000 0.000 {method 'popitem' of 'dict' objects}
2 0.000 0.000 0.000 0.000 {method 'recv' of '_socket.socket' objects}
3 0.000 0.000 0.000 0.000 {method 'release' of '_thread.RLock' objects}
1 0.000 0.000 0.000 0.000 {method 'remove' of 'set' objects}
2 0.000 0.000 0.000 0.000 {method 'send' of '_socket.socket' objects}
9 0.000 0.000 0.000 0.000 {method 'send' of 'generator' objects}
21 0.000 0.000 0.000 0.000 {method 'update' of 'dict' objects}
$ /c/Python33/python bench.py
879 function calls in 0.000 seconds
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
30 0.000 0.000 0.000 0.000 :0(append)
1 0.000 0.000 0.000 0.000 :0(exec)
25 0.000 0.000 0.000 0.000 :0(format)
9 0.000 0.000 0.000 0.000 :0(heappop)
9 0.000 0.000 0.000 0.000 :0(heappush)
48 0.000 0.000 0.000 0.000 :0(isinstance)
27 0.000 0.000 0.000 0.000 :0(len)
14 0.000 0.000 0.000 0.000 :0(max)
98 0.000 0.000 0.000 0.000 :0(monotonic)
1 0.000 0.000 0.000 0.000 :0(next)
20 0.000 0.000 0.000 0.000 :0(popleft)
25 0.000 0.000 0.000 0.000 :0(select)
9 0.000 0.000 0.000 0.000 :0(send)
1 0.000 0.000 0.000 0.000 :0(setprofile)
1 0.000 0.000 0.000 0.000 <string>:1(<module>)
25 0.000 0.000 0.000 0.000 __init__.py:1284(log)
25 0.000 0.000 0.000 0.000 __init__.py:1453(getEffectiveLevel)
25 0.000 0.000 0.000 0.000 __init__.py:1467(isEnabledFor)
1 0.000 0.000 0.000 0.000 base_events.py:101(run_forever)
1 0.000 0.000 0.000 0.000 base_events.py:115(run_until_complete)
98 0.000 0.000 0.000 0.000 base_events.py:167(time)
9 0.000 0.000 0.000 0.000 base_events.py:171(call_later)
9 0.000 0.000 0.000 0.000 base_events.py:189(call_at)
11 0.000 0.000 0.000 0.000 base_events.py:195(call_soon)
1 0.000 0.000 0.000 0.000 base_events.py:44(_raise_stop_error)
25 0.000 0.000 0.000 0.000 base_events.py:556(_run_once)
6 0.000 0.000 0.000 0.000 bench.py:14(sub_sub)
10 0.000 0.000 0.000 0.000 bench.py:20(sub)
10 0.000 0.000 0.000 0.000 bench.py:27(main)
1 0.000 0.000 0.000 0.000 bench.py:34(bench)
9 0.000 0.000 0.000 0.000 bench.py:8(async_func)
20 0.000 0.000 0.000 0.000 events.py:24(__init__)
9 0.000 0.000 0.000 0.000 events.py:323(get_event_loop)
9 0.000 0.000 0.000 0.000 events.py:365(get_event_loop_policy)
20 0.000 0.000 0.000 0.000 events.py:38(_run)
9 0.000 0.000 0.000 0.000 events.py:381(get_event_loop)
11 0.000 0.000 0.000 0.000 events.py:47(make_handle)
9 0.000 0.000 0.000 0.000 events.py:56(__init__)
10 0.000 0.000 0.000 0.000 futures.py:140(__init__)
10 0.000 0.000 0.000 0.000 futures.py:197(_schedule_callbacks)
29 0.000 0.000 0.000 0.000 futures.py:222(done)
19 0.000 0.000 0.000 0.000 futures.py:230(result)
10 0.000 0.000 0.000 0.000 futures.py:265(add_done_callback)
1 0.000 0.000 0.000 0.000 futures.py:279(remove_done_callback)
1 0.000 0.000 0.000 0.000 futures.py:284(<listcomp>)
10 0.000 0.000 0.000 0.000 futures.py:292(set_result)
18 0.000 0.000 0.000 0.000 futures.py:339(__iter__)
2 0.000 0.000 0.000 0.000 inspect.py:184(isgenerator)
1 0.000 0.000 0.000 0.000 profile:0(bench())
0 0.000 0.000 profile:0(profiler)
25 0.000 0.000 0.000 0.000 selector_events.py:300(_process_events)
25 0.000 0.000 0.000 0.000 selectors.py:227(select)
25 0.000 0.000 0.000 0.000 selectors.py:249(_select)
10 0.000 0.000 0.000 0.000 tasks.py:114(_step)
9 0.000 0.000 0.000 0.000 tasks.py:183(_wakeup)
1 0.000 0.000 0.000 0.000 tasks.py:344(async)
1 0.000 0.000 0.000 0.000 tasks.py:47(iscoroutine)
1 0.000 0.000 0.000 0.000 tasks.py:75(__init__)
DEBUG:tulip:Using selector: SelectSelector
DEBUG:tulip:poll0.000 took 0.000 seconds
DEBUG:tulip:poll0.010 took 0.016 seconds
DEBUG:tulip:poll0.000 took 0.000 seconds
DEBUG:tulip:poll0.010 took 0.015 seconds
DEBUG:tulip:poll0.000 took 0.000 seconds
DEBUG:tulip:poll0.010 took 0.000 seconds
DEBUG:tulip:poll0.010 took 0.016 seconds
DEBUG:tulip:poll0.000 took 0.000 seconds
DEBUG:tulip:poll0.010 took 0.015 seconds
DEBUG:tulip:poll0.000 took 0.000 seconds
DEBUG:tulip:poll0.010 took 0.000 seconds
DEBUG:tulip:poll0.010 took 0.016 seconds
DEBUG:tulip:poll0.000 took 0.000 seconds
DEBUG:tulip:poll0.010 took 0.016 seconds
DEBUG:tulip:poll0.000 took 0.000 seconds
DEBUG:tulip:poll0.010 took 0.000 seconds
DEBUG:tulip:poll0.010 took 0.015 seconds
DEBUG:tulip:poll0.000 took 0.000 seconds
DEBUG:tulip:poll0.010 took 0.016 seconds
DEBUG:tulip:poll0.000 took 0.000 seconds
DEBUG:tulip:poll0.010 took 0.000 seconds
DEBUG:tulip:poll0.010 took 0.015 seconds
DEBUG:tulip:poll0.000 took 0.000 seconds
DEBUG:tulip:poll0.000 took 0.000 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment