Skip to content

Instantly share code, notes, and snippets.

@davebshow
Last active July 24, 2017 01:28
Show Gist options
  • Save davebshow/64a1fc98e5892585f9de to your computer and use it in GitHub Desktop.
Save davebshow/64a1fc98e5892585f9de to your computer and use it in GitHub Desktop.
This gist details some simple profiling that I did to compare compare a Tornado based client implementation vs. a Aiohttp based implementation of gremlinclient. To do so, I simply dropped the Aiohttp websocket client in the place of the Tornado client in gremlinclient like shown in the following file. Next I did a simple IPython %timeit, followe…
import asyncio
import collections
import json
import uuid
import aiohttp
Message = collections.namedtuple(
"Message",
["status_code", "data", "message", "metadata"])
class GremlinClient(object):
"""Main interface for interacting with the Gremlin Server.
:param str url: url for Gremlin Server (optional). 'http://localhost:8182/'
by default
:param loop:
:param str lang: Language of scripts submitted to the server.
"gremlin-groovy" by default
:param str op: Gremlin Server op argument. "eval" by default.
:param str processor: Gremlin Server processor argument. "" by default.
:param float timeout: timeout for establishing connection (optional).
Values ``0`` or ``None`` mean no timeout
:param connector: A class that implements the method ``ws_connect``.
Usually an instance of ``aiogremlin.connector.GremlinConnector``
"""
def __init__(self, url='ws://localhost:8182/', loop=None,
lang="gremlin-groovy", processor="", timeout=None,
username="", password=""):
self._lang = lang
self._processor = processor
self._closed = False
self._session = None
self._url = url
self._timeout = timeout
self._username = username
self._password = password
self._response = GremlinResponse
@property
def processor(self):
"""Readonly property. The processor argument for Gremlin
Server"""
return self._processor
@property
def lang(self):
"""Readonly property. The language used for Gremlin scripts"""
return self._lang
@property
def url(self):
"""Getter/setter for database url used by the client"""
return self._url
@url.setter
def url(self, value):
self._url = value
@property
def closed(self):
"""Readonly property. Return True if client has been closed"""
pass
def close(self):
pass
def submit(self, gremlin, bindings=None, lang=None, rebindings=None,
op="eval", processor=None, session=None,
timeout=None, mime_type="application/json", handler=None):
"""
:ref:`coroutine<coroutine>` method.
Submit a script to the Gremlin Server.
:param str gremlin: Gremlin script to submit to server.
:param dict bindings: A mapping of bindings for Gremlin script.
:param str lang: Language of scripts submitted to the server.
"gremlin-groovy" by default
:param dict rebindings: Rebind ``Graph`` and ``TraversalSource``
objects to different variable names in the current request
:param str op: Gremlin Server op argument. "eval" by default.
:param str processor: Gremlin Server processor argument. "" by default.
:param float timeout: timeout for establishing connection (optional).
Values ``0`` or ``None`` mean no timeout
:param str session: Session id (optional). Typically a uuid
:param loop: :ref:`event loop<asyncio-event-loop>` If param is ``None``
`asyncio.get_event_loop` is used for getting default event loop
(optional)
:returns: :py:class:`gremlinclient.client.GremlinResponse` object
"""
lang = lang or self.lang
processor = processor or self.processor
if session is None:
session = self._session
if timeout is None:
timeout = self._timeout
if rebindings is None:
rebindings = {}
message = self._prepare_message(
gremlin, bindings=bindings, lang=lang, rebindings=rebindings,
op=op, processor=processor, session=session)
message = self._set_message_header(message, mime_type)
future = asyncio.Future()
future_conn = asyncio.ensure_future(aiohttp.ws_connect(self.url))
def send_message(f):
conn = f.result()
conn.send_bytes(message)
future.set_result(self._response(conn, handler=handler))
future_conn.add_done_callback(send_message)
return future
@staticmethod
def _prepare_message(gremlin, bindings, lang, rebindings, op, processor,
session):
message = json.dumps({
"requestId": str(uuid.uuid4()),
"op": op,
"processor": processor,
"args": {
"gremlin": gremlin,
"bindings": bindings,
"language": lang,
"rebindings": rebindings
}
})
if session is None:
if processor == "session":
raise RuntimeError("session processor requires a session id")
else:
message["args"].update({"session": session})
return message
@staticmethod
def _set_message_header(message, mime_type):
if mime_type == "application/json":
mime_len = b"\x10"
mime_type = b"application/json"
else:
raise ValueError("Unknown mime type.")
return b"".join([mime_len, mime_type, message.encode("utf-8")])
class GremlinResponse(object):
"""This will be a context manager"""
def __init__(self, conn, session=None, loop=None, username="",
password="", handler=None):
self._conn = conn
self._closed = False
self._username = username
self._password = password
self._handler = handler
def add_handler(self, func):
self._handler = func
def read(self):
future = asyncio.Future()
if self._closed:
future.set_result(None)
else:
future_resp = asyncio.ensure_future(self._conn.receive())
def parser(f):
msg = f.result()
if msg.tp == aiohttp.MsgType.binary:
message = json.loads(msg.data.decode("utf-8"))
message = Message(message["status"]["code"],
message["result"]["data"],
message["status"]["message"],
message["result"]["meta"])
if self._handler is None:
self._handler = lambda x: x
if message.status_code == 200:
future.set_result(self._handler(message))
# self._conn.close(code=1000)
self._closed = True
elif message.status_code == 206:
future.set_result(self._handler(message))
elif message.status_code == 407:
# Set up auth/ssl here
pass
elif message.status_code == 204:
future.set_result(self._handler(message))
# self._conn.close(code=1000)
self._closed = True
else:
future.set_exception(RuntimeError(
"{0} {1}".format(message.status_code, message.message)))
# self._conn.close(code=1006)
self._closed = True
future_resp.add_done_callback(parser)
return future
# @staticmethod
# def _authenticate(username, password, session, processor):
# auth = b"".join([b"\x00", bytes(username, "utf-8"), b"\x00", bytes(password, "utf-8")])
# message = {
# "requestId": str(uuid.uuid4()),
# "op": "authentication",
# "processor": processor,
# "args": {
# "sasl": base64.b64encode(auth).decode()
# }
# }
# if session is None:
# if processor == "session":
# raise RuntimeError("session processor requires a session id")
# else:
# message["args"].update({"session": session})
# return message
def submit(gremlin,
url='ws://localhost:8182/',
bindings=None,
lang="gremlin-groovy",
rebindings=None,
op="eval",
processor="",
timeout=None,
session=None,
loop=None,
username="",
password="",
handler=None):
gc = GremlinClient(url=url, username=username, password=password)
try:
future_resp = gc.submit(gremlin, bindings=bindings, lang=lang,
rebindings=rebindings, op=op,
processor=processor, session=session,
timeout=timeout, handler=handler)
return future_resp
finally:
gc.close()
This gist details some simple profiling that I did to compare compare a Tornado based client implementation vs. a Aiohttp based implementation of gremlinclient. To do so, I simply dropped the Aiohttp websocket client in the place of the Tornado client in gremlinclient like shown in the following file. Next I did a simple IPython %timeit, followed by five runs each with a profiler that outputs aggregated stats. Results show bottlenecks in the Aiohttp implementation.
import random
# This submit is from the above client.py file
from gremlinclient import submit
async def aio_go():
# This will be changed to a context manager probably
resp = await submit("x + x", bindings={"x": random.randint(1, 9)})
results = []
while True:
msg = await resp.read()
if msg is None:
# This is done inside client with tornado
await resp._conn.close()
break
results.append(msg)
return results
# This is from the original gremlinclient implementaion
from gremlinclient import aiosubmit
async def gc_go():
resp = await aiosubmit("x + x", bindings={"x": random.randint(1, 9)})
results = []
while True:
msg = await resp.read()
if msg is None:
break
results.append(msg)
return results
import asyncio
loop = asyncio.get_event_loop()
%timeit loop.run_until_complete(aio_go())
# 10 loops, best of 3: 19.9 ms per loop
loop.close()
import asyncio
from tornado.platform.asyncio import AsyncIOMainLoop
AsyncIOMainLoop().install()
loop = asyncio.get_event_loop()
%timeit loop.run_until_complete(gc_go())
# 100 loops, best of 3: 9.11 ms per loop
loop.close()
import profile
import pstats
import asyncio
from tornado.platform.asyncio import AsyncIOMainLoop
from gc_script import gc_go
try:
AsyncIOMainLoop().install()
except AssertionError:
pass
loop = asyncio.get_event_loop()
# Create 5 set of stats
filenames = []
for i in range(5):
filename = 'gc_profile_stats_%d.stats' % i
profile.run('print(%d), loop.run_until_complete(gc_go())' % i, filename)
# Read all 5 stats files into a single object
stats = pstats.Stats('gc_profile_stats_0.stats')
for i in range(1, 5):
stats.add('gc_profile_stats_%d.stats' % i)
stats.strip_dirs()
# Sort the statistics by the cumulative time spent in the function
stats.sort_stats('cumulative')
stats.print_stats()
loop.close()
45869 function calls (45643 primitive calls) in 0.192 seconds
Ordered by: cumulative time
ncalls tottime percall cumtime percall filename:lineno(function)
5 0.000 0.000 0.191 0.038 :0(exec)
5 0.000 0.000 0.191 0.038 <string>:1(<module>)
5 0.000 0.000 0.191 0.038 base_events.py:303(run_until_complete)
5 0.000 0.000 0.182 0.036 base_events.py:286(run_forever)
50 0.002 0.000 0.182 0.004 base_events.py:1158(_run_once)
85 0.000 0.000 0.176 0.002 events.py:123(_run)
110 0.001 0.000 0.128 0.001 traceback.py:196(extract_stack)
110 0.035 0.000 0.127 0.001 traceback.py:313(extract)
90 0.001 0.000 0.114 0.001 events.py:83(__init__)
35 0.000 0.000 0.092 0.003 ioloop.py:594(_run_callback)
35 0.000 0.000 0.091 0.003 stack_context.py:281(wrapped)
80/70 0.001 0.000 0.071 0.001 :0(send)
30 0.000 0.000 0.069 0.002 stack_context.py:271(null_wrapper)
55 0.001 0.000 0.067 0.001 base_events.py:452(_call_soon)
15 0.000 0.000 0.058 0.004 tasks.py:223(_step)
15 0.000 0.000 0.053 0.004 gc_script.py:15(gc_go)
80/55 0.000 0.000 0.051 0.001 concurrent.py:264(set_result)
80/55 0.000 0.000 0.051 0.001 concurrent.py:313(_set_done)
1 0.000 0.000 0.048 0.048 profile:0(print(0), loop.run_until_complete(gc_go()))
15 0.000 0.000 0.047 0.003 gen.py:990(run)
20 0.000 0.000 0.045 0.002 iostream.py:551(wrapper)
2410 0.011 0.000 0.045 0.000 traceback.py:279(line)
5 0.000 0.000 0.044 0.009 aioclient.py:33(aiosubmit)
5 0.000 0.000 0.044 0.009 aioclient.py:16(submit)
10 0.000 0.000 0.043 0.004 gen.py:257(wrapper)
35 0.000 0.000 0.043 0.001 asyncio.py:142(add_callback)
35 0.000 0.000 0.043 0.001 base_events.py:480(call_soon_threadsafe)
10 0.000 0.000 0.040 0.004 gen.py:938(__init__)
5 0.000 0.000 0.040 0.008 client.py:73(submit)
5 0.000 0.000 0.039 0.008 websocket.py:1015(websocket_connect)
5 0.000 0.000 0.038 0.008 websocket.py:884(__init__)
5 0.000 0.000 0.038 0.008 gen.py:264(<lambda>)
5 0.001 0.000 0.037 0.007 simple_httpclient.py:297(_on_connect)
5 0.000 0.000 0.037 0.007 simple_httpclient.py:183(__init__)
1 0.000 0.000 0.036 0.036 profile:0(print(3), loop.run_until_complete(gc_go()))
1 0.000 0.000 0.036 0.036 profile:0(print(1), loop.run_until_complete(gc_go()))
1 0.000 0.000 0.036 0.036 profile:0(print(2), loop.run_until_complete(gc_go()))
1 0.000 0.000 0.036 0.036 profile:0(print(4), loop.run_until_complete(gc_go()))
5 0.000 0.000 0.032 0.006 websocket.py:776(_on_frame_data)
20 0.000 0.000 0.031 0.002 ioloop.py:470(add_timeout)
2350 0.011 0.000 0.031 0.000 linecache.py:15(getline)
20 0.000 0.000 0.031 0.002 asyncio.py:131(call_at)
20 0.000 0.000 0.030 0.001 base_events.py:396(call_later)
20 0.000 0.000 0.030 0.001 base_events.py:417(call_at)
20 0.000 0.000 0.028 0.001 events.py:145(__init__)
5 0.000 0.000 0.026 0.005 simple_httpclient.py:389(_write_body)
5 0.000 0.000 0.025 0.005 simple_httpclient.py:408(_read_response)
20 0.000 0.000 0.025 0.001 base_events.py:435(call_soon)
10 0.000 0.000 0.024 0.002 asyncio.py:112(_handle_events)
10 0.000 0.000 0.024 0.002 iostream.py:497(_handle_events)
5 0.000 0.000 0.024 0.005 websocket.py:814(_handle_message)
10 0.000 0.000 0.024 0.002 websocket.py:998(on_message)
5 0.000 0.000 0.024 0.005 websocket.py:411(_run_callback)
5 0.000 0.000 0.024 0.005 client.py:172(parser)
20 0.000 0.000 0.023 0.001 iostream.py:550(_run_callback)
15 0.000 0.000 0.023 0.002 tcpclient.py:156(connect)
5 0.000 0.000 0.021 0.004 tcpclient.py:80(start)
20 0.000 0.000 0.021 0.001 iostream.py:294(read_bytes)
20 0.000 0.000 0.021 0.001 futures.py:322(set_result)
20 0.000 0.000 0.021 0.001 futures.py:230(_schedule_callbacks)
25 0.000 0.000 0.021 0.001 iostream.py:688(_try_inline_read)
15 0.000 0.000 0.021 0.001 ioloop.py:592(<lambda>)
5 0.000 0.000 0.019 0.004 http1connection.py:138(read_response)
15 0.000 0.000 0.019 0.001 iostream.py:903(_add_io_state)
10 0.000 0.000 0.018 0.002 http1connection.py:153(_read_message)
20 0.000 0.000 0.018 0.001 iostream.py:762(_read_from_buffer)
20 0.000 0.000 0.018 0.001 iostream.py:669(_run_read_callback)
15 0.000 0.000 0.017 0.001 concurrent.py:499(copy)
1140 0.008 0.000 0.017 0.000 linecache.py:53(checkcache)
2350 0.007 0.000 0.017 0.000 linecache.py:37(getlines)
15 0.000 0.000 0.016 0.001 asyncio.py:79(update_handler)
20 0.000 0.000 0.016 0.001 futures.py:142(__init__)
5 0.000 0.000 0.016 0.003 websocket.py:918(close)
5 0.000 0.000 0.016 0.003 websocket.py:852(close)
2350 0.010 0.000 0.014 0.000 linecache.py:147(lazycache)
10 0.000 0.000 0.014 0.001 tasks.py:288(_wakeup)
5 0.000 0.000 0.014 0.003 http1connection.py:613(headers_received)
5 0.000 0.000 0.013 0.003 websocket.py:949(headers_received)
10 0.000 0.000 0.013 0.001 selector_events.py:229(add_reader)
8556/8548 0.013 0.000 0.013 0.000 :0(len)
15 0.000 0.000 0.013 0.001 asyncio.py:201(to_asyncio_future)
5 0.000 0.000 0.012 0.002 tcpclient.py:85(try_connect)
5 0.000 0.000 0.012 0.002 tcpclient.py:177(_create_stream)
5 0.000 0.000 0.012 0.002 iostream.py:1026(connect)
5 0.000 0.000 0.011 0.002 asyncio.py:65(add_handler)
5 0.000 0.000 0.011 0.002 selector_events.py:267(add_writer)
5 0.000 0.000 0.011 0.002 client.py:112(send_message)
15 0.000 0.000 0.010 0.001 iostream.py:360(write)
10 0.000 0.000 0.009 0.001 websocket.py:653(_write_frame)
5 0.000 0.000 0.009 0.002 iostream.py:1176(_handle_connect)
5 0.000 0.000 0.009 0.002 tcpclient.py:124(set_timout)
5 0.000 0.000 0.009 0.002 tcpclient.py:100(on_connect_done)
10 0.000 0.000 0.009 0.001 websocket.py:700(_receive_frame)
10 0.000 0.000 0.009 0.001 aioclient.py:28(read)
5 0.000 0.000 0.008 0.002 tasks.py:527(ensure_future)
5 0.000 0.000 0.008 0.002 base_events.py:204(create_task)
5 0.000 0.000 0.008 0.002 tasks.py:69(__init__)
5 0.000 0.000 0.008 0.002 gen.py:1097(<lambda>)
65 0.000 0.000 0.008 0.000 iostream.py:887(_maybe_add_error_listener)
125 0.001 0.000 0.007 0.000 linecache.py:82(updatecache)
70 0.000 0.000 0.007 0.000 concurrent.py:251(add_done_callback)
1030 0.007 0.000 0.007 0.000 :0(stat)
5 0.000 0.000 0.007 0.001 websocket.py:706(_on_frame_start)
30 0.000 0.000 0.007 0.000 events.py:112(cancel)
5 0.000 0.000 0.006 0.001 websocket.py:741(_on_frame_length_16)
15 0.000 0.000 0.006 0.000 ioloop.py:582(add_future)
75/30 0.000 0.000 0.006 0.000 :0(repr)
30 0.000 0.000 0.006 0.000 events.py:106(__repr__)
15 0.000 0.000 0.006 0.000 iostream.py:440(_maybe_run_close_callback)
5 0.000 0.000 0.006 0.001 iostream.py:645(_handle_read)
30 0.001 0.000 0.006 0.000 events.py:95(_repr_info)
2904 0.005 0.000 0.005 0.000 :0(append)
30 0.000 0.000 0.005 0.000 events.py:69(_format_callback_source)
20 0.000 0.000 0.005 0.000 re.py:278(_compile)
1135 0.002 0.000 0.005 0.000 :0(isinstance)
4 0.000 0.000 0.005 0.001 sre_compile.py:531(compile)
15 0.000 0.000 0.004 0.000 re.py:160(match)
2350 0.004 0.000 0.004 0.000 traceback.py:239(__init__)
2386 0.004 0.000 0.004 0.000 :0(add)
2460 0.004 0.000 0.004 0.000 traceback.py:286(walk_stack)
15 0.000 0.000 0.004 0.000 asyncio.py:139(remove_timeout)
15 0.000 0.000 0.004 0.000 events.py:190(cancel)
30 0.000 0.000 0.004 0.000 events.py:50(_format_callback)
2365 0.003 0.000 0.003 0.000 :0(strip)
30 0.000 0.000 0.003 0.000 events.py:38(_format_args)
15 0.000 0.000 0.003 0.000 events.py:153(_repr_info)
15 0.002 0.000 0.003 0.000 :0(readlines)
30 0.000 0.000 0.003 0.000 reprlib.py:53(repr)
15 0.000 0.000 0.003 0.000 :0(next)
75/30 0.001 0.000 0.003 0.000 reprlib.py:56(repr1)
10 0.000 0.000 0.003 0.000 selector_events.py:245(remove_reader)
20 0.000 0.000 0.003 0.000 iostream.py:585(_read_to_buffer_loop)
145 0.001 0.000 0.002 0.000 abc.py:178(__instancecheck__)
30 0.000 0.000 0.002 0.000 reprlib.py:79(repr_tuple)
4 0.000 0.000 0.002 0.001 sre_parse.py:819(parse)
4 0.000 0.000 0.002 0.001 sre_compile.py:516(_code)
5 0.000 0.000 0.002 0.000 httputil.py:800(parse_response_start_line)
5 0.000 0.000 0.002 0.000 http1connection.py:331(write_headers)
20 0.000 0.000 0.002 0.000 iostream.py:721(_read_to_buffer)
30 0.000 0.000 0.002 0.000 reprlib.py:66(_repr_iterable)
9/4 0.000 0.000 0.002 0.001 sre_parse.py:429(_parse_sub)
85 0.000 0.000 0.002 0.000 coroutines.py:255(iscoroutine)
9/4 0.001 0.000 0.002 0.000 sre_parse.py:491(_parse)
20 0.000 0.000 0.002 0.000 iostream.py:1010(read_from_fd)
513/488 0.002 0.000 0.002 0.000 :0(getattr)
5 0.000 0.000 0.002 0.000 selector_events.py:283(remove_writer)
15 0.000 0.000 0.002 0.000 tokenize.py:450(open)
75 0.000 0.000 0.002 0.000 coroutines.py:244(iscoroutinefunction)
5 0.000 0.000 0.002 0.000 iostream.py:414(close)
16/4 0.001 0.000 0.002 0.000 sre_compile.py:64(_compile)
5 0.000 0.000 0.002 0.000 httputil.py:883(split_host_and_port)
35 0.000 0.000 0.002 0.000 functools.py:742(wrapper)
20 0.000 0.000 0.001 0.000 iostream.py:827(_handle_write)
30 0.000 0.000 0.001 0.000 reprlib.py:73(<listcomp>)
50 0.001 0.000 0.001 0.000 selectors.py:415(select)
5 0.000 0.000 0.001 0.000 iostream.py:229(read_until_regex)
5 0.000 0.000 0.001 0.000 asyncio.py:100(remove_handler)
5 0.000 0.000 0.001 0.000 tcpclient.py:132(clear_timeout)
165 0.001 0.000 0.001 0.000 httpclient.py:623(__getattr__)
5 0.000 0.000 0.001 0.000 simple_httpclient.py:292(_remove_timeout)
5 0.000 0.000 0.001 0.000 concurrent.py:386(wrapper)
170 0.001 0.000 0.001 0.000 stack_context.py:253(wrap)
15 0.000 0.000 0.001 0.000 gen.py:1051(handle_yield)
75 0.001 0.000 0.001 0.000 inspect.py:180(iscoroutinefunction)
5 0.000 0.000 0.001 0.000 concurrent.py:351(submit)
30 0.000 0.000 0.001 0.000 events.py:23(_get_function_source)
5 0.000 0.000 0.001 0.000 http1connection.py:499(_parse_headers)
5 0.000 0.000 0.001 0.000 netutil.py:376(resolve)
5 0.000 0.000 0.001 0.000 websocket.py:973(write_message)
5 0.000 0.000 0.001 0.000 websocket.py:680(write_message)
15 0.000 0.000 0.001 0.000 tokenize.py:357(detect_encoding)
5 0.000 0.000 0.001 0.000 socket.py:715(getaddrinfo)
255 0.001 0.000 0.001 0.000 base_events.py:387(time)
270 0.001 0.000 0.001 0.000 :0(startswith)
10 0.000 0.000 0.001 0.000 selectors.py:244(modify)
30 0.000 0.000 0.001 0.000 selectors.py:170(get_key)
5 0.000 0.000 0.001 0.000 httputil.py:187(parse)
20 0.000 0.000 0.001 0.000 selectors.py:395(register)
5 0.000 0.000 0.001 0.000 http1connection.py:375(<listcomp>)
270 0.001 0.000 0.001 0.000 :0(hasattr)
5 0.000 0.000 0.001 0.000 re.py:222(compile)
80 0.000 0.000 0.001 0.000 codecs.py:318(decode)
8/6 0.000 0.000 0.001 0.000 abc.py:194(__subclasscheck__)
35 0.000 0.000 0.001 0.000 functools.py:704(dispatch)
15 0.000 0.000 0.001 0.000 _collections_abc.py:756(update)
250 0.001 0.000 0.001 0.000 :0(endswith)
50 0.000 0.000 0.001 0.000 iostream.py:1510(_merge_prefix)
5 0.001 0.000 0.001 0.000 :0(getaddrinfo)
5 0.000 0.000 0.001 0.000 client.py:121(_prepare_message)
80 0.000 0.000 0.001 0.000 selectors.py:205(_fileobj_lookup)
20 0.000 0.000 0.001 0.000 selector_events.py:125(_read_from_self)
35 0.000 0.000 0.001 0.000 gen.py:1200(convert_yielded)
233 0.001 0.000 0.001 0.000 _weakrefset.py:70(__contains__)
80 0.000 0.000 0.001 0.000 escape.py:193(utf8)
60 0.001 0.000 0.001 0.000 :0(recv)
15 0.000 0.000 0.001 0.000 httputil.py:170(parse_line)
20 0.000 0.000 0.001 0.000 iostream.py:876(_consume)
20 0.000 0.000 0.001 0.000 selectors.py:405(unregister)
50 0.000 0.000 0.001 0.000 selector_events.py:477(_process_events)
30 0.000 0.000 0.000 0.000 selectors.py:59(__getitem__)
4 0.000 0.000 0.000 0.000 sre_compile.py:412(_compile_info)
20 0.000 0.000 0.000 0.000 selectors.py:224(register)
5 0.000 0.000 0.000 0.000 httpclient.py:300(__init__)
15 0.000 0.000 0.000 0.000 iostream.py:1023(write_to_fd)
5 0.000 0.000 0.000 0.000 websocket.py:607(_process_server_headers)
15 0.000 0.000 0.000 0.000 reprlib.py:139(repr_instance)
5 0.000 0.000 0.000 0.000 simple_httpclient.py:377(_create_connection)
5 0.000 0.000 0.000 0.000 http1connection.py:432(finish)
30 0.000 0.000 0.000 0.000 inspect.py:447(unwrap)
35 0.000 0.000 0.000 0.000 concurrent.py:236(exception)
5 0.000 0.000 0.000 0.000 :0(setprofile)
15 0.000 0.000 0.000 0.000 iostream.py:1199(set_nodelay)
105 0.000 0.000 0.000 0.000 inspect.py:158(isfunction)
2 0.000 0.000 0.000 0.000 functools.py:664(_find_impl)
35 0.000 0.000 0.000 0.000 selector_events.py:137(_write_to_self)
80 0.000 0.000 0.000 0.000 selectors.py:20(_fileobj_to_fd)
2 0.000 0.000 0.000 0.000 functools.py:623(_compose_mro)
5 0.000 0.000 0.000 0.000 :0(connect)
15 0.000 0.000 0.000 0.000 iostream.py:396(<lambda>)
25 0.000 0.000 0.000 0.000 socket.py:87(_intenum_converter)
23 0.000 0.000 0.000 0.000 tokenize.py:387(find_cookie)
25 0.000 0.000 0.000 0.000 iostream.py:404(set_close_callback)
50 0.000 0.000 0.000 0.000 :0(poll)
28/16 0.000 0.000 0.000 0.000 sre_parse.py:167(getwidth)
80 0.000 0.000 0.000 0.000 :0(utf_8_decode)
15 0.000 0.000 0.000 0.000 httputil.py:144(add)
11 0.000 0.000 0.000 0.000 httputil.py:86(__missing__)
30 0.000 0.000 0.000 0.000 _collections_abc.py:599(__contains__)
105 0.000 0.000 0.000 0.000 :0(max)
25 0.000 0.000 0.000 0.000 iostream.py:660(_set_read_callback)
60 0.000 0.000 0.000 0.000 sre_parse.py:157(__getitem__)
15 0.000 0.000 0.000 0.000 :0(open)
255 0.000 0.000 0.000 0.000 :0(monotonic)
5/2 0.000 0.000 0.000 0.000 functools.py:578(_c3_mro)
30 0.000 0.000 0.000 0.000 base_events.py:1140(_add_callback)
45 0.000 0.000 0.000 0.000 iostream.py:772(_find_read_pos)
35 0.000 0.000 0.000 0.000 stack_context.py:227(_remove_deactivated)
4 0.000 0.000 0.000 0.000 sre_compile.py:221(_compile_charset)
45 0.000 0.000 0.000 0.000 httputil.py:203(__setitem__)
12 0.000 0.000 0.000 0.000 _weakrefset.py:58(__iter__)
15 0.000 0.000 0.000 0.000 concurrent.py:493(chain_future)
20 0.000 0.000 0.000 0.000 selectors.py:237(unregister)
5 0.000 0.000 0.000 0.000 uuid.py:600(uuid4)
30 0.000 0.000 0.000 0.000 reprlib.py:131(repr_int)
60 0.000 0.000 0.000 0.000 traceback.py:269(__getitem__)
130 0.000 0.000 0.000 0.000 :0(popleft)
63 0.000 0.000 0.000 0.000 :0(match)
5 0.000 0.000 0.000 0.000 http1connection.py:488(_finish_request)
55 0.000 0.000 0.000 0.000 httputil.py:208(__getitem__)
55 0.000 0.000 0.000 0.000 concurrent.py:220(result)
15 0.000 0.000 0.000 0.000 socket.py:419(family)
5 0.000 0.000 0.000 0.000 __init__.py:271(loads)
5 0.000 0.000 0.000 0.000 __init__.py:182(dumps)
5 0.000 0.000 0.000 0.000 inspect.py:210(isawaitable)
10 0.000 0.000 0.000 0.000 httputil.py:129(__init__)
70 0.000 0.000 0.000 0.000 inspect.py:80(ismethod)
5 0.000 0.000 0.000 0.000 websocket.py:541(compute_accept_value)
46 0.000 0.000 0.000 0.000 sre_parse.py:247(get)
5 0.000 0.000 0.000 0.000 tcpclient.py:143(__init__)
20 0.000 0.000 0.000 0.000 http1connection.py:263(_clear_callbacks)
5 0.000 0.000 0.000 0.000 encoder.py:182(encode)
40 0.000 0.000 0.000 0.000 base_events.py:463(_check_thread)
4 0.000 0.000 0.000 0.000 sre_compile.py:248(_optimize_charset)
36 0.000 0.000 0.000 0.000 <string>:12(__new__)
131 0.000 0.000 0.000 0.000 :0(get)
25 0.000 0.000 0.000 0.000 enum.py:209(__call__)
5 0.000 0.000 0.000 0.000 parse.py:321(urlsplit)
23 0.000 0.000 0.000 0.000 tokenize.py:381(read_or_stop)
5 0.000 0.000 0.000 0.000 iostream.py:1001(close_fd)
110 0.000 0.000 0.000 0.000 :0(_getframe)
96 0.000 0.000 0.000 0.000 :0(join)
5 0.000 0.000 0.000 0.000 decoder.py:334(decode)
5 0.000 0.000 0.000 0.000 util.py:207(__new__)
50 0.000 0.000 0.000 0.000 concurrent.py:346(is_future)
5 0.000 0.000 0.000 0.000 random.py:214(randint)
10 0.000 0.000 0.000 0.000 client.py:165(read)
20 0.000 0.000 0.000 0.000 :0(urandom)
5 0.000 0.000 0.000 0.000 uuid.py:106(__init__)
155 0.000 0.000 0.000 0.000 iostream.py:478(closed)
5 0.000 0.000 0.000 0.000 socket.py:403(close)
80 0.000 0.000 0.000 0.000 concurrent.py:163(__init__)
30 0.000 0.000 0.000 0.000 inspect.py:464(_is_wrapper)
25 0.000 0.000 0.000 0.000 futures.py:355(__iter__)
5 0.000 0.000 0.000 0.000 httpclient.py:462(headers)
140 0.000 0.000 0.000 0.000 base_events.py:1290(get_debug)
5/2 0.000 0.000 0.000 0.000 functools.py:616(<listcomp>)
5 0.000 0.000 0.000 0.000 sre_parse.py:90(closegroup)
62 0.000 0.000 0.000 0.000 :0(min)
5 0.000 0.000 0.000 0.000 socket.py:399(_real_close)
20 0.000 0.000 0.000 0.000 :0(heappush)
5 0.000 0.000 0.000 0.000 random.py:170(randrange)
8/7 0.000 0.000 0.000 0.000 :0(issubclass)
5 0.000 0.000 0.000 0.000 http1connection.py:90(__init__)
35 0.000 0.000 0.000 0.000 ioloop.py:455(time)
23 0.000 0.000 0.000 0.000 :0(readline)
5 0.000 0.000 0.000 0.000 iostream.py:993(__init__)
110 0.000 0.000 0.000 0.000 :0(reverse)
105 0.000 0.000 0.000 0.000 base_events.py:282(_check_closed)
15 0.000 0.000 0.000 0.000 events.py:624(get_event_loop)
5 0.000 0.000 0.000 0.000 encoder.py:204(iterencode)
7 0.000 0.000 0.000 0.000 sre_compile.py:386(_simple)
5 0.000 0.000 0.000 0.000 :0(print)
5 0.000 0.000 0.000 0.000 websocket.py:934(on_connection_close)
10 0.000 0.000 0.000 0.000 _collections_abc.py:592(get)
58 0.000 0.000 0.000 0.000 sre_parse.py:226(__next)
36 0.000 0.000 0.000 0.000 :0(split)
90 0.000 0.000 0.000 0.000 concurrent.py:214(_clear_tb_log)
30 0.000 0.000 0.000 0.000 iostream.py:883(_check_closed)
5 0.000 0.000 0.000 0.000 functools.py:551(_c3_merge)
70 0.000 0.000 0.000 0.000 :0(encode)
31 0.000 0.000 0.000 0.000 sre_parse.py:165(append)
20 0.000 0.000 0.000 0.000 ioloop.py:188(current)
20 0.000 0.000 0.000 0.000 :0(register)
20 0.000 0.000 0.000 0.000 :0(unregister)
10 0.000 0.000 0.000 0.000 base_events.py:1257(_set_coroutine_wrapper)
38 0.000 0.000 0.000 0.000 :0(decode)
5 0.000 0.000 0.000 0.000 idna.py:147(encode)
5 0.000 0.000 0.000 0.000 tcpclient.py:50(__init__)
41 0.000 0.000 0.000 0.000 :0(__new__)
20 0.000 0.000 0.000 0.000 escape.py:210(to_unicode)
5 0.000 0.000 0.000 0.000 random.py:220(_randbelow)
15 0.000 0.000 0.000 0.000 gen.py:621(_contains_yieldpoint)
25 0.000 0.000 0.000 0.000 ioloop.py:631(split_fd)
5 0.000 0.000 0.000 0.000 http1connection.py:302(detach)
5 0.000 0.000 0.000 0.000 http1connection.py:461(_on_write_complete)
8 0.000 0.000 0.000 0.000 _weakrefset.py:26(__exit__)
20 0.000 0.000 0.000 0.000 :0(ord)
11 0.000 0.000 0.000 0.000 httputil.py:87(<listcomp>)
24 0.000 0.000 0.000 0.000 sre_parse.py:276(tell)
35 0.000 0.000 0.000 0.000 httputil.py:160(get_all)
65 0.000 0.000 0.000 0.000 futures.py:250(done)
35 0.000 0.000 0.000 0.000 weakref.py:364(__getitem__)
5 0.000 0.000 0.000 0.000 websocket.py:1010(get_websocket_protocol)
55 0.000 0.000 0.000 0.000 concurrent.py:327(__del__)
15 0.000 0.000 0.000 0.000 codecs.py:308(__init__)
5 0.000 0.000 0.000 0.000 socket.py:129(__init__)
25 0.000 0.000 0.000 0.000 stack_context.py:219(__enter__)
5 0.000 0.000 0.000 0.000 parse.py:137(username)
5 0.000 0.000 0.000 0.000 iostream.py:136(__init__)
25 0.000 0.000 0.000 0.000 :0(pack)
5 0.000 0.000 0.000 0.000 websocket.py:600(_parse_extensions_header)
20 0.000 0.000 0.000 0.000 :0(format)
45 0.000 0.000 0.000 0.000 :0(pop)
25 0.000 0.000 0.000 0.000 enum.py:453(__new__)
5 0.000 0.000 0.000 0.000 sre_parse.py:78(opengroup)
10 0.000 0.000 0.000 0.000 gen.py:332(__init__)
23 0.000 0.000 0.000 0.000 sre_parse.py:153(__len__)
7 0.000 0.000 0.000 0.000 :0(heappop)
5 0.000 0.000 0.000 0.000 __init__.py:1330(log)
32 0.000 0.000 0.000 0.000 sre_parse.py:242(match)
18 0.000 0.000 0.000 0.000 sre_parse.py:75(groups)
5 0.000 0.000 0.000 0.000 futures.py:309(remove_done_callback)
13 0.000 0.000 0.000 0.000 _weakrefset.py:81(add)
10 0.000 0.000 0.000 0.000 base64.py:51(b64encode)
40 0.000 0.000 0.000 0.000 :0(get_ident)
5 0.000 0.000 0.000 0.000 decoder.py:345(raw_decode)
15 0.000 0.000 0.000 0.000 futures.py:295(add_done_callback)
40 0.000 0.000 0.000 0.000 :0(time)
19 0.000 0.000 0.000 0.000 :0(find)
5 0.000 0.000 0.000 0.000 aioclient.py:8(__init__)
50 0.000 0.000 0.000 0.000 concurrent.py:210(done)
30 0.000 0.000 0.000 0.000 futures.py:258(result)
15 0.000 0.000 0.000 0.000 :0(setsockopt)
30 0.000 0.000 0.000 0.000 :0(id)
5 0.000 0.000 0.000 0.000 websocket.py:495(__init__)
37 0.000 0.000 0.000 0.000 events.py:162(__lt__)
15 0.000 0.000 0.000 0.000 :0(seek)
35 0.000 0.000 0.000 0.000 iostream.py:754(_run_streaming_callback)
25 0.000 0.000 0.000 0.000 stack_context.py:223(__exit__)
5 0.000 0.000 0.000 0.000 client.py:142(_set_message_header)
35 0.000 0.000 0.000 0.000 stack_context.py:230(<listcomp>)
5 0.000 0.000 0.000 0.000 parse.py:168(_userinfo)
5 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:996(_handle_fromlist)
8 0.000 0.000 0.000 0.000 _weakrefset.py:20(__enter__)
5 0.000 0.000 0.000 0.000 base_events.py:118(_run_until_complete_cb)
40 0.000 0.000 0.000 0.000 concurrent.py:309(_check_done)
3 0.000 0.000 0.000 0.000 sre_parse.py:362(_escape)
6 0.000 0.000 0.000 0.000 _weakrefset.py:36(__init__)
5 0.000 0.000 0.000 0.000 :0(search)
5 0.000 0.000 0.000 0.000 httpclient.py:481(body_producer)
20 0.000 0.000 0.000 0.000 unix_events.py:60(_process_self_data)
30 0.000 0.000 0.000 0.000 selectors.py:266(_key_from_fd)
24 0.000 0.000 0.000 0.000 :0(items)
5 0.000 0.000 0.000 0.000 uuid.py:225(__str__)
4 0.000 0.000 0.000 0.000 sre_parse.py:217(__init__)
5 0.000 0.000 0.000 0.000 httpclient.py:473(body)
25 0.000 0.000 0.000 0.000 :0(group)
5 0.000 0.000 0.000 0.000 netutil.py:396(initialize)
30 0.000 0.000 0.000 0.000 selectors.py:263(get_map)
5 0.000 0.000 0.000 0.000 simple_httpclient.py:413(<lambda>)
24 0.000 0.000 0.000 0.000 :0(capitalize)
5 0.000 0.000 0.000 0.000 __init__.py:1515(isEnabledFor)
15 0.000 0.000 0.000 0.000 events.py:561(get_event_loop)
5 0.000 0.000 0.000 0.000 parse.py:100(_coerce_args)
30 0.000 0.000 0.000 0.000 httpclient.py:458(headers)
23 0.000 0.000 0.000 0.000 :0(remove)
5 0.000 0.000 0.000 0.000 tcpclient.py:60(split)
20 0.000 0.000 0.000 0.000 :0(end)
15 0.000 0.000 0.000 0.000 :0(update)
5 0.000 0.000 0.000 0.000 websocket.py:977(read_message)
5 0.000 0.000 0.000 0.000 httpclient.py:505(prepare_curl_callback)
5 0.000 0.000 0.000 0.000 httpclient.py:489(streaming_callback)
5 0.000 0.000 0.000 0.000 tcpclient.py:152(close)
8 0.000 0.000 0.000 0.000 sre_compile.py:513(isstring)
25 0.000 0.000 0.000 0.000 :0(fileno)
25 0.000 0.000 0.000 0.000 iostream.py:998(fileno)
16 0.000 0.000 0.000 0.000 sre_parse.py:105(__init__)
2 0.000 0.000 0.000 0.000 functools.py:635(<listcomp>)
15 0.000 0.000 0.000 0.000 :0(insert)
5 0.000 0.000 0.000 0.000 httpclient.py:497(header_callback)
5 0.000 0.000 0.000 0.000 _weakrefset.py:38(_remove)
10 0.000 0.000 0.000 0.000 :0(websocket_mask)
5 0.000 0.000 0.000 0.000 util.py:263(configured_class)
5 0.000 0.000 0.000 0.000 :0(from_bytes)
5 0.000 0.000 0.000 0.000 tasks.py:84(__del__)
15 0.000 0.000 0.000 0.000 base_events.py:1153(_timer_handle_cancelled)
4 0.000 0.000 0.000 0.000 :0(compile)
15 0.000 0.000 0.000 0.000 :0(isspace)
9 0.000 0.000 0.000 0.000 :0(getrandbits)
5 0.000 0.000 0.000 0.000 :0(ceil)
10 0.000 0.000 0.000 0.000 :0(unpack)
20 0.000 0.000 0.000 0.000 :0(appendleft)
14 0.000 0.000 0.000 0.000 functools.py:559(<listcomp>)
5 0.000 0.000 0.000 0.000 util.py:166(errno_from_exception)
4 0.000 0.000 0.000 0.000 sre_parse.py:797(fix_flags)
10 0.000 0.000 0.000 0.000 iostream.py:474(writing)
10 0.000 0.000 0.000 0.000 :0(b2a_base64)
15 0.000 0.000 0.000 0.000 codecs.py:259(__init__)
5 0.000 0.000 0.000 0.000 :0(getsockopt)
5 0.000 0.000 0.000 0.000 client.py:32(__init__)
1 0.000 0.000 0.000 0.000 parse.py:313(_splitnetloc)
10 0.000 0.000 0.000 0.000 gen.py:1114(_deactivate_stack_context)
11 0.000 0.000 0.000 0.000 :0(lower)
5 0.000 0.000 0.000 0.000 :0(openssl_sha1)
5 0.000 0.000 0.000 0.000 :0(digest)
8 0.000 0.000 0.000 0.000 _weakrefset.py:16(__init__)
5 0.000 0.000 0.000 0.000 stack_context.py:188(__enter__)
15 0.000 0.000 0.000 0.000 events.py:608(get_event_loop_policy)
15 0.000 0.000 0.000 0.000 httpclient.py:469(body)
15 0.000 0.000 0.000 0.000 base_events.py:369(is_closed)
8 0.000 0.000 0.000 0.000 _weakrefset.py:52(_commit_removals)
5 0.000 0.000 0.000 0.000 :0(rpartition)
5 0.000 0.000 0.000 0.000 http1connection.py:61(__init__)
4 0.000 0.000 0.000 0.000 functools.py:632(is_related)
5 0.000 0.000 0.000 0.000 :0(count)
5 0.000 0.000 0.000 0.000 client.py:154(__init__)
10 0.000 0.000 0.000 0.000 iostream.py:470(reading)
5 0.000 0.000 0.000 0.000 stack_context.py:195(__exit__)
5 0.000 0.000 0.000 0.000 websocket.py:404(__init__)
10 0.000 0.000 0.000 0.000 futures.py:201(__del__)
10 0.000 0.000 0.000 0.000 :0(get_coroutine_wrapper)
5 0.000 0.000 0.000 0.000 :0(partition)
5 0.000 0.000 0.000 0.000 netutil.py:362(initialize)
10 0.000 0.000 0.000 0.000 :0(set_coroutine_wrapper)
10 0.000 0.000 0.000 0.000 gen.py:157(_value_from_stopiteration)
5 0.000 0.000 0.000 0.000 :0(rstrip)
10 0.000 0.000 0.000 0.000 httpclient.py:477(body_producer)
5 0.000 0.000 0.000 0.000 :0(lstrip)
5 0.000 0.000 0.000 0.000 :0(bit_length)
5 0.000 0.000 0.000 0.000 :0(setblocking)
3 0.000 0.000 0.000 0.000 _collections_abc.py:137(__subclasshook__)
5 0.000 0.000 0.000 0.000 __init__.py:1501(getEffectiveLevel)
10 0.000 0.000 0.000 0.000 netutil.py:317(configurable_base)
5 0.000 0.000 0.000 0.000 :0(extend)
5 0.000 0.000 0.000 0.000 stack_context.py:177(__init__)
5 0.000 0.000 0.000 0.000 http1connection.py:608(__init__)
5 0.000 0.000 0.000 0.000 netutil.py:371(close)
7 0.000 0.000 0.000 0.000 sre_parse.py:161(__setitem__)
4 0.000 0.000 0.000 0.000 sre_parse.py:70(__init__)
5 0.000 0.000 0.000 0.000 httpclient.py:619(__init__)
5 0.000 0.000 0.000 0.000 http1connection.py:474(_can_keep_alive)
5 0.000 0.000 0.000 0.000 functools.py:614(<listcomp>)
5 0.000 0.000 0.000 0.000 simple_httpclient.py:238(_get_ssl_options)
5 0.000 0.000 0.000 0.000 simple_httpclient.py:453(on_connection_close)
5 0.000 0.000 0.000 0.000 :0(__subclasses__)
5 0.000 0.000 0.000 0.000 functools.py:615(<listcomp>)
5 0.000 0.000 0.000 0.000 http1connection.py:46(__init__)
5 0.000 0.000 0.000 0.000 futures.py:314(<listcomp>)
5 0.000 0.000 0.000 0.000 :0(iter)
5 0.000 0.000 0.000 0.000 iostream.py:820(_check_max_bytes)
5 0.000 0.000 0.000 0.000 :0(discard)
5 0.000 0.000 0.000 0.000 base_events.py:383(is_running)
5 0.000 0.000 0.000 0.000 client.py:56(url)
5 0.000 0.000 0.000 0.000 client.py:45(processor)
5 0.000 0.000 0.000 0.000 http1connection.py:52(__exit__)
5 0.000 0.000 0.000 0.000 parse.py:89(_noop)
2 0.000 0.000 0.000 0.000 :0(keys)
5 0.000 0.000 0.000 0.000 base_events.py:339(stop)
5 0.000 0.000 0.000 0.000 http1connection.py:49(__enter__)
5 0.000 0.000 0.000 0.000 client.py:70(close)
2 0.000 0.000 0.000 0.000 weakref.py:377(__setitem__)
5 0.000 0.000 0.000 0.000 client.py:179(<lambda>)
2 0.000 0.000 0.000 0.000 :0(__subclasshook__)
1 0.000 0.000 0.000 0.000 _collections_abc.py:92(__subclasshook__)
2 0.000 0.000 0.000 0.000 functools.py:643(<listcomp>)
2 0.000 0.000 0.000 0.000 _collections_abc.py:308(__subclasshook__)
1 0.000 0.000 0.000 0.000 netutil.py:321(configurable_default)
0 0.000 0.000 profile:0(profiler)
import profile
import pstats
import asyncio
from aio_script import aio_go
loop = asyncio.get_event_loop()
# Create 5 set of stats
filenames = []
for i in range(5):
filename = 'aio_profile_stats_%d.stats' % i
profile.run('print(%d), loop.run_until_complete(aio_go())' % i, filename)
# Read all 5 stats files into a single object
stats = pstats.Stats('aio_profile_stats_0.stats')
for i in range(1, 5):
stats.add('aio_profile_stats_%d.stats' % i)
# Clean up filenames for the report
stats.strip_dirs()
# Sort the statistics by the cumulative time spent in the function
stats.sort_stats('cumulative')
stats.print_stats()
loop.close()
109281 function calls (108629 primitive calls) in 0.433 seconds
Ordered by: cumulative time
ncalls tottime percall cumtime percall filename:lineno(function)
7/5 0.000 0.000 0.433 0.087 :0(exec)
5 0.000 0.000 0.432 0.086 <string>:1(<module>)
5 0.000 0.000 0.432 0.086 base_events.py:303(run_until_complete)
5 0.001 0.000 0.423 0.085 base_events.py:286(run_forever)
105 0.005 0.000 0.422 0.004 base_events.py:1158(_run_once)
150 0.001 0.000 0.411 0.003 events.py:123(_run)
353 0.003 0.000 0.349 0.001 traceback.py:196(extract_stack)
353 0.099 0.000 0.346 0.001 traceback.py:313(extract)
65 0.001 0.000 0.344 0.005 tasks.py:223(_step)
323/75 0.002 0.000 0.331 0.004 :0(send)
220/50 0.001 0.000 0.240 0.005 coroutines.py:104(__next__)
40 0.000 0.000 0.233 0.006 coroutines.py:120(send)
25 0.000 0.000 0.205 0.008 client.py:463(send)
25 0.001 0.000 0.205 0.008 client.py:246(_ws_connect)
25 0.000 0.000 0.195 0.008 client.py:492(__iter__)
25 0.001 0.000 0.195 0.008 client.py:124(_request)
40 0.000 0.000 0.184 0.005 tasks.py:288(_wakeup)
138 0.001 0.000 0.133 0.001 events.py:83(__init__)
123 0.002 0.000 0.125 0.001 base_events.py:452(_call_soon)
120 0.001 0.000 0.121 0.001 base_events.py:435(call_soon)
115 0.001 0.000 0.121 0.001 coroutines.py:227(wrapper)
20 0.000 0.000 0.119 0.006 connector.py:275(connect)
115 0.001 0.000 0.119 0.001 coroutines.py:86(__init__)
6741 0.031 0.000 0.118 0.000 traceback.py:279(line)
20 0.000 0.000 0.107 0.005 connector.py:553(_create_connection)
1 0.000 0.000 0.096 0.096 profile:0(print(0), loop.run_until_complete(aio_go()))
20 0.000 0.000 0.094 0.005 base_events.py:548(create_connection)
20 0.000 0.000 0.090 0.004 aio_script.py:6(aio_go)
1 0.000 0.000 0.085 0.085 profile:0(print(2), loop.run_until_complete(aio_go()))
1 0.000 0.000 0.085 0.085 profile:0(print(3), loop.run_until_complete(aio_go()))
1 0.000 0.000 0.084 0.084 profile:0(print(4), loop.run_until_complete(aio_go()))
1 0.000 0.000 0.084 0.084 profile:0(print(1), loop.run_until_complete(aio_go()))
6691 0.032 0.000 0.078 0.000 linecache.py:15(getline)
75 0.001 0.000 0.078 0.001 futures.py:142(__init__)
75 0.000 0.000 0.069 0.001 futures.py:230(_schedule_callbacks)
65 0.000 0.000 0.059 0.001 futures.py:322(set_result)
30 0.000 0.000 0.052 0.002 tasks.py:527(ensure_future)
25 0.000 0.000 0.052 0.002 base_events.py:204(create_task)
25 0.000 0.000 0.051 0.002 tasks.py:69(__init__)
2943 0.022 0.000 0.045 0.000 linecache.py:53(checkcache)
6691 0.027 0.000 0.040 0.000 linecache.py:147(lazycache)
6691 0.020 0.000 0.037 0.000 linecache.py:37(getlines)
22611 0.034 0.000 0.034 0.000 :0(len)
5 0.000 0.000 0.032 0.006 client.py:220(submit)
10 0.000 0.000 0.032 0.003 websocket_client.py:91(close)
5 0.000 0.000 0.032 0.006 client.py:69(submit)
10 0.000 0.000 0.029 0.003 base_events.py:672(_create_connection_transport)
5 0.000 0.000 0.026 0.005 client_reqrep.py:460(send)
25 0.000 0.000 0.025 0.001 streams.py:576(read)
5 0.000 0.000 0.022 0.004 selector_events.py:57(_make_socket_transport)
5 0.000 0.000 0.022 0.004 selector_events.py:627(__init__)
10 0.000 0.000 0.022 0.002 tasks.py:349(wait_for)
10 0.000 0.000 0.021 0.002 client.py:162(read)
10 0.000 0.000 0.020 0.002 client_reqrep.py:588(start)
15 0.000 0.000 0.019 0.001 selector_events.py:662(_read_ready)
5 0.000 0.000 0.018 0.004 base_events.py:536(getaddrinfo)
5 0.000 0.000 0.018 0.004 base_events.py:488(run_in_executor)
2600 0.018 0.000 0.018 0.000 :0(stat)
5 0.000 0.000 0.016 0.003 client.py:693(ws_connect)
10 0.000 0.000 0.015 0.002 tasks.py:312(wait)
5 0.000 0.000 0.015 0.003 selector_events.py:385(sock_connect)
5 0.000 0.000 0.015 0.003 client_reqrep.py:63(__init__)
5 0.000 0.000 0.014 0.003 futures.py:445(wrap_future)
7214 0.012 0.000 0.012 0.000 :0(append)
5 0.000 0.000 0.011 0.002 client_reqrep.py:367(write_bytes)
6874 0.011 0.000 0.011 0.000 :0(add)
6691 0.011 0.000 0.011 0.000 traceback.py:239(__init__)
10 0.000 0.000 0.011 0.001 futures.py:334(set_exception)
369 0.004 0.000 0.010 0.000 linecache.py:82(updatecache)
7044 0.010 0.000 0.010 0.000 traceback.py:286(walk_stack)
25 0.000 0.000 0.010 0.000 streams.py:424(read)
5 0.000 0.000 0.009 0.002 futures.py:422(_set_state)
1386/1385 0.003 0.000 0.009 0.000 :0(isinstance)
5 0.000 0.000 0.009 0.002 futures.py:388(_copy_future_state)
6771 0.009 0.000 0.009 0.000 :0(strip)
5 0.000 0.000 0.009 0.002 websocket_client.py:132(receive)
5 0.000 0.000 0.009 0.002 selector_events.py:428(_sock_connect_cb)
5 0.000 0.000 0.008 0.002 selector_events.py:408(_sock_connect)
10 0.000 0.000 0.008 0.001 parsers.py:310(data_received)
10 0.000 0.000 0.008 0.001 parsers.py:132(feed_data)
5 0.000 0.000 0.008 0.002 selector_events.py:267(add_writer)
10 0.000 0.000 0.008 0.001 tasks.py:395(_wait)
10 0.000 0.000 0.008 0.001 protocol.py:216(__call__)
213 0.002 0.000 0.006 0.000 abc.py:178(__instancecheck__)
5 0.000 0.000 0.006 0.001 futures.py:408(_chain_future)
10 0.000 0.000 0.006 0.001 streams.py:562(feed_data)
5 0.000 0.000 0.006 0.001 parsers.py:313(eof_received)
10 0.000 0.000 0.006 0.001 parsers.py:151(feed_eof)
10 0.000 0.000 0.006 0.001 streams.py:405(feed_data)
5 0.000 0.000 0.006 0.001 _base.py:361(add_done_callback)
3 0.000 0.000 0.006 0.002 futures.py:435(_call_set_state)
3 0.000 0.000 0.006 0.002 base_events.py:480(call_soon_threadsafe)
5 0.000 0.000 0.006 0.001 streams.py:396(set_exception)
5 0.000 0.000 0.006 0.001 client_reqrep.py:98(update_host)
5 0.000 0.000 0.005 0.001 connector.py:409(__init__)
5 0.000 0.000 0.005 0.001 connector.py:115(__init__)
5 0.000 0.000 0.005 0.001 base_events.py:396(call_later)
5 0.000 0.000 0.005 0.001 base_events.py:417(call_at)
198 0.001 0.000 0.005 0.000 coroutines.py:255(iscoroutine)
5 0.000 0.000 0.005 0.001 client.py:108(send_message)
5 0.000 0.000 0.005 0.001 connector.py:42(__init__)
10 0.000 0.000 0.005 0.000 selector_events.py:562(close)
5 0.000 0.000 0.005 0.001 client_reqrep.py:541(_post_init)
5 0.000 0.000 0.005 0.001 events.py:145(__init__)
5 0.000 0.000 0.005 0.001 streams.py:291(drain)
40/30 0.000 0.000 0.005 0.000 :0(encode)
15 0.000 0.000 0.005 0.000 events.py:112(cancel)
5 0.000 0.000 0.005 0.001 client.py:34(__init__)
50/15 0.000 0.000 0.005 0.000 :0(repr)
15 0.000 0.000 0.005 0.000 events.py:106(__repr__)
5 0.000 0.000 0.005 0.001 protocol.py:720(write_eof)
5 0.000 0.000 0.005 0.001 client.py:169(parser)
1 0.000 0.000 0.004 0.004 __init__.py:69(search_function)
5 0.000 0.000 0.004 0.001 client.py:360(get)
15 0.000 0.000 0.004 0.000 events.py:95(_repr_info)
1 0.000 0.000 0.004 0.004 :0(__import__)
3/1 0.000 0.000 0.004 0.004 <frozen importlib._bootstrap>:966(_find_and_load)
3/1 0.000 0.000 0.004 0.004 <frozen importlib._bootstrap>:939(_find_and_load_unlocked)
5 0.000 0.000 0.004 0.001 tasks.py:408(_on_completion)
5 0.000 0.000 0.004 0.001 tasks.py:344(_release_waiter)
5 0.000 0.000 0.004 0.001 futures.py:366(_set_result_unless_cancelled)
15 0.000 0.000 0.004 0.000 events.py:69(_format_callback_source)
3/1 0.000 0.000 0.004 0.004 <frozen importlib._bootstrap>:659(_load_unlocked)
60/12 0.001 0.000 0.004 0.000 abc.py:194(__subclasscheck__)
1406 0.004 0.000 0.004 0.000 :0(getattr)
2/1 0.000 0.000 0.004 0.004 <frozen importlib._bootstrap_external>:656(exec_module)
15 0.000 0.000 0.003 0.000 events.py:50(_format_callback)
5 0.000 0.000 0.003 0.001 thread.py:104(submit)
4/1 0.000 0.000 0.003 0.003 <frozen importlib._bootstrap>:214(_call_with_frames_removed)
1 0.000 0.000 0.003 0.003 idna.py:3(<module>)
5 0.000 0.000 0.003 0.001 selector_events.py:229(add_reader)
15 0.000 0.000 0.003 0.000 events.py:38(_format_args)
25/15 0.000 0.000 0.003 0.000 reprlib.py:53(repr)
55/15 0.000 0.000 0.003 0.000 reprlib.py:56(repr1)
58/15 0.000 0.000 0.003 0.000 :0(issubclass)
5 0.000 0.000 0.003 0.001 thread.py:117(_adjust_thread_count)
20/15 0.000 0.000 0.003 0.000 reprlib.py:79(repr_tuple)
105 0.001 0.000 0.003 0.000 selectors.py:415(select)
20/15 0.000 0.000 0.003 0.000 reprlib.py:66(_repr_iterable)
5 0.000 0.000 0.003 0.001 selector_events.py:425(_sock_connect_done)
5 0.000 0.000 0.003 0.001 selector_events.py:283(remove_writer)
5 0.000 0.000 0.003 0.001 client.py:343(_prepare_headers)
133 0.001 0.000 0.003 0.000 coroutines.py:244(iscoroutinefunction)
16 0.002 0.000 0.002 0.000 :0(readlines)
5 0.000 0.000 0.002 0.000 threading.py:826(start)
759 0.002 0.000 0.002 0.000 :0(startswith)
20/15 0.000 0.000 0.002 0.000 reprlib.py:73(<listcomp>)
5 0.000 0.000 0.002 0.000 threading.py:531(wait)
45 0.001 0.000 0.002 0.000 protocol.py:593(add_header)
5 0.000 0.000 0.002 0.000 threading.py:261(wait)
729 0.002 0.000 0.002 0.000 :0(endswith)
45 0.000 0.000 0.002 0.000 multidict.py:285(__setitem__)
25 0.002 0.000 0.002 0.000 :0(acquire)
5 0.000 0.000 0.002 0.000 events.py:190(cancel)
5 0.000 0.000 0.002 0.000 client_reqrep.py:161(update_path)
133 0.001 0.000 0.002 0.000 inspect.py:180(iscoroutinefunction)
25/15 0.000 0.000 0.002 0.000 reprlib.py:139(repr_instance)
45 0.000 0.000 0.002 0.000 multidict.py:219(__setitem__)
16 0.000 0.000 0.002 0.000 tokenize.py:450(open)
5 0.000 0.000 0.002 0.000 events.py:153(_repr_info)
145 0.001 0.000 0.002 0.000 multidict.py:281(add)
422 0.001 0.000 0.001 0.000 base_events.py:387(time)
30 0.000 0.000 0.001 0.000 multidict.py:166(__init__)
3 0.000 0.000 0.001 0.000 <frozen importlib._bootstrap>:879(_find_spec)
68 0.001 0.000 0.001 0.000 _weakrefset.py:58(__iter__)
103 0.001 0.000 0.001 0.000 coroutines.py:171(__del__)
45 0.000 0.000 0.001 0.000 multidict.py:291(_replace)
1 0.000 0.000 0.001 0.001 re.py:222(compile)
1 0.000 0.000 0.001 0.001 re.py:278(_compile)
1 0.000 0.000 0.001 0.001 sre_compile.py:531(compile)
2 0.000 0.000 0.001 0.001 <frozen importlib._bootstrap_external>:1130(find_spec)
30 0.000 0.000 0.001 0.000 multidict.py:187(_extend)
2 0.000 0.000 0.001 0.001 <frozen importlib._bootstrap_external>:1098(_get_spec)
10 0.000 0.000 0.001 0.000 websocket.py:284(_send_frame)
6 0.000 0.000 0.001 0.000 <frozen importlib._bootstrap_external>:1212(find_spec)
5 0.000 0.000 0.001 0.000 selector_events.py:245(remove_reader)
45 0.000 0.000 0.001 0.000 multidict.py:273(_replace)
485 0.001 0.000 0.001 0.000 _weakrefset.py:70(__contains__)
5 0.000 0.000 0.001 0.000 protocol.py:639(send_headers)
1 0.000 0.000 0.001 0.001 sre_compile.py:516(_code)
15 0.000 0.000 0.001 0.000 parsers.py:170(set_parser)
2 0.000 0.000 0.001 0.000 sre_compile.py:221(_compile_charset)
2 0.001 0.000 0.001 0.000 sre_compile.py:248(_optimize_charset)
5 0.000 0.000 0.001 0.000 client_reqrep.py:196(update_auto_headers)
5 0.000 0.000 0.001 0.000 protocol.py:62(parse_headers)
105 0.001 0.000 0.001 0.000 :0(poll)
40 0.000 0.000 0.001 0.000 multidict.py:120(get)
16 0.000 0.000 0.001 0.000 tokenize.py:357(detect_encoding)
15 0.000 0.000 0.001 0.000 streams.py:273(write)
10 0.000 0.000 0.001 0.000 futures.py:193(__repr__)
5 0.000 0.000 0.001 0.000 client_reqrep.py:184(update_headers)
25 0.000 0.000 0.001 0.000 :0(next)
5 0.000 0.000 0.001 0.000 websocket_client.py:83(send_bytes)
105 0.000 0.000 0.001 0.000 selector_events.py:477(_process_events)
5 0.000 0.000 0.001 0.000 websocket.py:324(send)
15 0.000 0.000 0.001 0.000 selector_events.py:684(write)
5 0.000 0.000 0.001 0.000 websocket.py:333(close)
15 0.000 0.000 0.001 0.000 websocket.py:76(WebSocketParser)
10 0.000 0.000 0.001 0.000 futures.py:176(_repr_info)
5 0.000 0.000 0.001 0.000 client.py:117(_prepare_message)
125 0.000 0.000 0.001 0.000 base_events.py:463(_check_thread)
69 0.000 0.000 0.001 0.000 codecs.py:318(decode)
353 0.001 0.000 0.001 0.000 :0(_getframe)
45 0.000 0.000 0.001 0.000 multidict.py:23(__new__)
2 0.000 0.000 0.001 0.000 <frozen importlib._bootstrap_external>:726(get_code)
145 0.000 0.000 0.001 0.000 multidict.py:171(add)
148 0.000 0.000 0.001 0.000 inspect.py:158(isfunction)
1 0.000 0.000 0.001 0.001 sre_compile.py:412(_compile_info)
60 0.000 0.000 0.001 0.000 multidict.py:130(__contains__)
20 0.000 0.000 0.001 0.000 selectors.py:170(get_key)
130 0.000 0.000 0.001 0.000 inspect.py:189(isgenerator)
58 0.000 0.000 0.001 0.000 _weakrefset.py:26(__exit__)
85 0.000 0.000 0.001 0.000 futures.py:355(__iter__)
40 0.000 0.000 0.001 0.000 multidict.py:63(get)
422 0.000 0.000 0.000 0.000 :0(monotonic)
5 0.000 0.000 0.000 0.000 client_reqrep.py:339(update_transfer_encoding)
32 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:50(_path_join)
5 0.000 0.000 0.000 0.000 socket.py:145(__repr__)
15 0.000 0.000 0.000 0.000 events.py:23(_get_function_source)
5 0.000 0.000 0.000 0.000 client_reqrep.py:633(close)
5 0.000 0.000 0.000 0.000 :0(setprofile)
410 0.000 0.000 0.000 0.000 multidict.py:34(upper)
1 0.000 0.000 0.000 0.000 sre_compile.py:64(_compile)
90 0.000 0.000 0.000 0.000 _weakrefset.py:81(add)
353 0.000 0.000 0.000 0.000 :0(reverse)
10 0.000 0.000 0.000 0.000 parse.py:321(urlsplit)
165 0.000 0.000 0.000 0.000 :0(popleft)
40 0.000 0.000 0.000 0.000 multidict.py:116(getone)
135 0.000 0.000 0.000 0.000 :0(max)
20 0.000 0.000 0.000 0.000 websocket.py:213(parse_frame)
1 0.000 0.000 0.000 0.000 stringprep.py:6(<module>)
10 0.000 0.000 0.000 0.000 selectors.py:395(register)
5 0.000 0.000 0.000 0.000 selector_events.py:607(_call_connection_lost)
15 0.000 0.000 0.000 0.000 random.py:170(randrange)
20 0.000 0.000 0.000 0.000 selectors.py:59(__getitem__)
5 0.000 0.000 0.000 0.000 protocol.py:277(__call__)
5 0.000 0.000 0.000 0.000 :0(connect)
95 0.000 0.000 0.000 0.000 inspect.py:80(ismethod)
75 0.000 0.000 0.000 0.000 futures.py:295(add_done_callback)
40 0.000 0.000 0.000 0.000 selectors.py:205(_fileobj_lookup)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:570(module_from_spec)
5 0.000 0.000 0.000 0.000 random.py:214(randint)
258 0.000 0.000 0.000 0.000 base_events.py:1290(get_debug)
5 0.000 0.000 0.000 0.000 helpers.py:431(requote_uri)
117 0.000 0.000 0.000 0.000 :0(hasattr)
5 0.000 0.000 0.000 0.000 queue.py:115(put)
25 0.000 0.000 0.000 0.000 :0(recv)
30 0.000 0.000 0.000 0.000 base_events.py:1140(_add_callback)
16 0.000 0.000 0.000 0.000 :0(open)
30 0.000 0.000 0.000 0.000 events.py:624(get_event_loop)
5 0.000 0.000 0.000 0.000 uuid.py:600(uuid4)
5 0.000 0.000 0.000 0.000 threading.py:755(__init__)
10 0.000 0.000 0.000 0.000 selectors.py:405(unregister)
5 0.000 0.000 0.000 0.000 __init__.py:271(loads)
5 0.000 0.000 0.000 0.000 client_reqrep.py:668(_cleanup_writer)
32 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:52(<listcomp>)
1 0.000 0.000 0.000 0.000 sre_parse.py:819(parse)
13 0.000 0.000 0.000 0.000 threading.py:213(__init__)
18 0.000 0.000 0.000 0.000 tokenize.py:387(find_cookie)
69 0.000 0.000 0.000 0.000 :0(utf_8_decode)
58 0.000 0.000 0.000 0.000 _weakrefset.py:20(__enter__)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:510(_init_module_attrs)
190 0.000 0.000 0.000 0.000 futures.py:250(done)
2 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:471(_compile_bytecode)
10 0.000 0.000 0.000 0.000 websocket.py:179(_websocket_mask_python)
5 0.000 0.000 0.000 0.000 __init__.py:182(dumps)
10 0.000 0.000 0.000 0.000 selectors.py:224(register)
20/15 0.000 0.000 0.000 0.000 :0(throw)
63 0.000 0.000 0.000 0.000 :0(format)
50 0.000 0.000 0.000 0.000 traceback.py:269(__getitem__)
10 0.000 0.000 0.000 0.000 parsers.py:391(readuntil)
178 0.000 0.000 0.000 0.000 base_events.py:282(_check_closed)
1 0.000 0.000 0.000 0.000 sre_parse.py:429(_parse_sub)
2 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:1207(_get_spec)
5 0.000 0.000 0.000 0.000 protocol.py:671(_add_default_headers)
5 0.000 0.000 0.000 0.000 :0(start_new_thread)
15 0.000 0.000 0.000 0.000 inspect.py:447(unwrap)
5 0.000 0.000 0.000 0.000 socket.py:403(close)
136 0.000 0.000 0.000 0.000 :0(get_ident)
2 0.000 0.000 0.000 0.000 :0(loads)
15 0.000 0.000 0.000 0.000 socket.py:87(_intenum_converter)
105 0.000 0.000 0.000 0.000 futures.py:258(result)
49 0.000 0.000 0.000 0.000 :0(match)
5 0.000 0.000 0.000 0.000 selector_events.py:508(__init__)
15 0.000 0.000 0.000 0.000 random.py:220(_randbelow)
5 0.000 0.000 0.000 0.000 encoder.py:182(encode)
30 0.000 0.000 0.000 0.000 parsers.py:359(read)
107 0.000 0.000 0.000 0.000 :0(join)
10 0.000 0.000 0.000 0.000 idna.py:147(encode)
5 0.000 0.000 0.000 0.000 decoder.py:334(decode)
4 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:243(cache_from_source)
10 0.000 0.000 0.000 0.000 parse.py:388(urlunsplit)
5 0.000 0.000 0.000 0.000 socket.py:399(_real_close)
10 0.000 0.000 0.000 0.000 socket.py:419(family)
5 0.000 0.000 0.000 0.000 parsers.py:283(__init__)
40 0.000 0.000 0.000 0.000 selectors.py:20(_fileobj_to_fd)
1 0.000 0.000 0.000 0.000 sre_parse.py:491(_parse)
1 0.000 0.000 0.000 0.000 thread.py:84(__init__)
5 0.000 0.000 0.000 0.000 base_events.py:73(_check_resolved_address)
35 0.000 0.000 0.000 0.000 threading.py:240(__exit__)
150 0.000 0.000 0.000 0.000 multidict.py:316(__iter__)
18 0.000 0.000 0.000 0.000 tokenize.py:381(read_or_stop)
10 0.000 0.000 0.000 0.000 parse.py:180(_hostinfo)
2 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:783(__init__)
31 0.000 0.000 0.000 0.000 <string>:12(__new__)
5 0.000 0.000 0.000 0.000 uuid.py:106(__init__)
1 0.000 0.000 0.000 0.000 queue.py:27(__init__)
20 0.000 0.000 0.000 0.000 parse.py:100(_coerce_args)
77 0.000 0.000 0.000 0.000 :0(__new__)
5 0.000 0.000 0.000 0.000 parse.py:670(quote)
5 0.000 0.000 0.000 0.000 protocol.py:876(__init__)
15 0.000 0.000 0.000 0.000 __init__.py:1257(debug)
5 0.000 0.000 0.000 0.000 selector_events.py:125(_read_from_self)
53 0.000 0.000 0.000 0.000 :0(decode)
5 0.000 0.000 0.000 0.000 protocol.py:664(<listcomp>)
5 0.000 0.000 0.000 0.000 parse.py:145(hostname)
5 0.000 0.000 0.000 0.000 client_reqrep.py:232(update_content_encoding)
45 0.000 0.000 0.000 0.000 :0(split)
21 0.000 0.000 0.000 0.000 __init__.py:1515(isEnabledFor)
5 0.000 0.000 0.000 0.000 helpers.py:389(__get__)
35 0.000 0.000 0.000 0.000 threading.py:237(__enter__)
5 0.000 0.000 0.000 0.000 :0(__build_class__)
10 0.000 0.000 0.000 0.000 futures.py:309(remove_done_callback)
5 0.000 0.000 0.000 0.000 client_reqrep.py:358(update_expect_continue)
5 0.000 0.000 0.000 0.000 protocol.py:538(__init__)
60 0.000 0.000 0.000 0.000 multidict.py:99(__contains__)
18 0.000 0.000 0.000 0.000 :0(readline)
75 0.000 0.000 0.000 0.000 :0(pop)
10 0.000 0.000 0.000 0.000 selectors.py:237(unregister)
4 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:406(cached)
15 0.000 0.000 0.000 0.000 enum.py:209(__call__)
5 0.000 0.000 0.000 0.000 client_reqrep.py:578(_setup_connection)
5 0.000 0.000 0.000 0.000 :0(print)
5 0.000 0.000 0.000 0.000 connector.py:80(close)
2 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:339(_get_cached)
5 0.000 0.000 0.000 0.000 encoder.py:204(iterencode)
5 0.000 0.000 0.000 0.000 parse.py:154(port)
20 0.000 0.000 0.000 0.000 multidict.py:80(items)
10 0.000 0.000 0.000 0.000 protocol.py:682(write)
5 0.000 0.000 0.000 0.000 parsers.py:90(__init__)
10/5 0.000 0.000 0.000 0.000 coroutines.py:123(throw)
10 0.000 0.000 0.000 0.000 base_events.py:1257(_set_coroutine_wrapper)
5 0.000 0.000 0.000 0.000 threading.py:332(notify)
61 0.000 0.000 0.000 0.000 :0(lower)
17 0.000 0.000 0.000 0.000 tasks.py:84(__del__)
58 0.000 0.000 0.000 0.000 :0(__subclasses__)
41 0.000 0.000 0.000 0.000 :0(rpartition)
73 0.000 0.000 0.000 0.000 :0(rstrip)
5 0.000 0.000 0.000 0.000 parse.py:731(quote_from_bytes)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:163(__enter__)
5 0.000 0.000 0.000 0.000 protocol.py:896(status_line)
58 0.000 0.000 0.000 0.000 _weakrefset.py:16(__init__)
10 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:68(_path_stat)
10 0.000 0.000 0.000 0.000 :0(urandom)
49 0.000 0.000 0.000 0.000 :0(get)
85 0.000 0.000 0.000 0.000 coroutines.py:101(__iter__)
67 0.000 0.000 0.000 0.000 :0(remove)
5 0.000 0.000 0.000 0.000 _base.py:285(__init__)
58 0.000 0.000 0.000 0.000 _weakrefset.py:52(_commit_removals)
40 0.000 0.000 0.000 0.000 multidict.py:49(getone)
5 0.000 0.000 0.000 0.000 socket.py:425(type)
28 0.000 0.000 0.000 0.000 _weakrefset.py:36(__init__)
17 0.000 0.000 0.000 0.000 _weakrefset.py:38(_remove)
46 0.000 0.000 0.000 0.000 :0(items)
5 0.000 0.000 0.000 0.000 parsers.py:294(connection_made)
5 0.000 0.000 0.000 0.000 helpers.py:409(unquote_unreserved)
24 0.000 0.000 0.000 0.000 :0(find)
29 0.000 0.000 0.000 0.000 :0(from_bytes)
16 0.000 0.000 0.000 0.000 codecs.py:308(__init__)
5 0.000 0.000 0.000 0.000 parsers.py:299(connection_lost)
49 0.000 0.000 0.000 0.000 futures.py:201(__del__)
5 0.000 0.000 0.000 0.000 transports.py:239(__init__)
30 0.000 0.000 0.000 0.000 events.py:561(get_event_loop)
10 0.000 0.000 0.000 0.000 streams.py:547(__init__)
5 0.000 0.000 0.000 0.000 socket.py:129(__init__)
5 0.000 0.000 0.000 0.000 _base.py:378(result)
5 0.000 0.000 0.000 0.000 _base.py:350(done)
2 0.000 0.000 0.000 0.000 sre_compile.py:374(_mk_bitmap)
5 0.000 0.000 0.000 0.000 threading.py:496(__init__)
5 0.000 0.000 0.000 0.000 connector.py:344(_release)
45 0.000 0.000 0.000 0.000 :0(issubset)
2 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:813(get_data)
15 0.000 0.000 0.000 0.000 inspect.py:464(_is_wrapper)
10 0.000 0.000 0.000 0.000 :0(getsockname)
10 0.000 0.000 0.000 0.000 parse.py:168(_userinfo)
5 0.000 0.000 0.000 0.000 parsers.py:333(__init__)
10 0.000 0.000 0.000 0.000 base64.py:51(b64encode)
6 0.000 0.000 0.000 0.000 __init__.py:1330(log)
16 0.000 0.000 0.000 0.000 parsers.py:345(_feed_data)
31 0.000 0.000 0.000 0.000 _collections_abc.py:137(__subclasshook__)
2 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:416(_validate_bytecode_header)
5 0.000 0.000 0.000 0.000 decoder.py:345(raw_decode)
5 0.000 0.000 0.000 0.000 parse.py:137(username)
5 0.000 0.000 0.000 0.000 streams.py:498(__init__)
5 0.000 0.000 0.000 0.000 _base.py:409(exception)
5 0.000 0.000 0.000 0.000 _base.py:340(cancelled)
5 0.000 0.000 0.000 0.000 multidict.py:70(__iter__)
5 0.000 0.000 0.000 0.000 client.py:565(__init__)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:321(__exit__)
10 0.000 0.000 0.000 0.000 :0(unregister)
35 0.000 0.000 0.000 0.000 :0(__enter__)
15 0.000 0.000 0.000 0.000 transports.py:18(get_extra_info)
21 0.000 0.000 0.000 0.000 __init__.py:1501(getEffectiveLevel)
15 0.000 0.000 0.000 0.000 enum.py:453(__new__)
5 0.000 0.000 0.000 0.000 parse.py:141(password)
5 0.000 0.000 0.000 0.000 connector.py:323(_get)
16 0.000 0.000 0.000 0.000 :0(seek)
32 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:363(_verbose_message)
5 0.000 0.000 0.000 0.000 tasks.py:339(<setcomp>)
5 0.000 0.000 0.000 0.000 client.py:138(_set_message_header)
30 0.000 0.000 0.000 0.000 :0(upper)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:176(_get_module_lock)
20 0.000 0.000 0.000 0.000 :0(partition)
25 0.000 0.000 0.000 0.000 multidict.py:302(__init__)
5 0.000 0.000 0.000 0.000 parsers.py:230(__init__)
5 0.000 0.000 0.000 0.000 client.py:330(_update_cookies)
5 0.000 0.000 0.000 0.000 reprlib.py:122(repr_str)
35 0.000 0.000 0.000 0.000 :0(__exit__)
30 0.000 0.000 0.000 0.000 selectors.py:266(_key_from_fd)
10 0.000 0.000 0.000 0.000 :0(register)
15 0.000 0.000 0.000 0.000 :0(getrandbits)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:716(find_spec)
10 0.000 0.000 0.000 0.000 threading.py:252(_is_owned)
4 0.000 0.000 0.000 0.000 :0(any)
2 0.000 0.000 0.000 0.000 sre_compile.py:376(<listcomp>)
20 0.000 0.000 0.000 0.000 :0(to_bytes)
10 0.000 0.000 0.000 0.000 :0(setblocking)
5 0.000 0.000 0.000 0.000 reprlib.py:131(repr_int)
15 0.000 0.000 0.000 0.000 :0(search)
30 0.000 0.000 0.000 0.000 futures.py:244(cancelled)
5 0.000 0.000 0.000 0.000 uuid.py:225(__str__)
4 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:56(_path_split)
5 0.000 0.000 0.000 0.000 client_reqrep.py:146(update_version)
5 0.000 0.000 0.000 0.000 websocket_client.py:33(__init__)
5 0.000 0.000 0.000 0.000 base_events.py:118(_run_until_complete_cb)
2 0.000 0.000 0.000 0.000 sre_compile.py:379(_bytes_to_codes)
30 0.000 0.000 0.000 0.000 events.py:608(get_event_loop_policy)
10 0.000 0.000 0.000 0.000 :0(getpeername)
10 0.000 0.000 0.000 0.000 client.py:417(closed)
15 0.000 0.000 0.000 0.000 :0(pack)
3 0.000 0.000 0.000 0.000 selector_events.py:137(_write_to_self)
25 0.000 0.000 0.000 0.000 multidict.py:355(__iter__)
2 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:87(_path_isfile)
15 0.000 0.000 0.000 0.000 :0(bit_length)
1 0.000 0.000 0.000 0.000 __init__.py:42(normalize_encoding)
1 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:737(create_module)
5 0.000 0.000 0.000 0.000 :0(openssl_sha1)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:170(__exit__)
6 0.000 0.000 0.000 0.000 sre_parse.py:247(get)
10 0.000 0.000 0.000 0.000 streams.py:379(__init__)
5 0.000 0.000 0.000 0.000 streams.py:84(__init__)
9 0.000 0.000 0.000 0.000 :0(release)
5 0.000 0.000 0.000 0.000 client_reqrep.py:528(__init__)
15 0.000 0.000 0.000 0.000 protocol.py:744(_write_length_payload)
5 0.000 0.000 0.000 0.000 threading.py:249(_acquire_restore)
18 0.000 0.000 0.000 0.000 :0(allocate_lock)
5 0.000 0.000 0.000 0.000 client.py:569(__del__)
5 0.000 0.000 0.000 0.000 multidict.py:76(keys)
19 0.000 0.000 0.000 0.000 _collections_abc.py:308(__subclasshook__)
5 0.000 0.000 0.000 0.000 weakref.py:377(__setitem__)
15 0.000 0.000 0.000 0.000 :0(id)
12 0.000 0.000 0.000 0.000 :0(extend)
1 0.000 0.000 0.000 0.000 parse.py:313(_splitnetloc)
5 0.000 0.000 0.000 0.000 coroutines.py:143(__await__)
7 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:856(__exit__)
1 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:436(spec_from_loader)
5 0.000 0.000 0.000 0.000 :0(digest)
2 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:823(path_stats)
5 0.000 0.000 0.000 0.000 client.py:79(__del__)
16 0.000 0.000 0.000 0.000 codecs.py:259(__init__)
2 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:78(_path_is_mode_type)
5 0.000 0.000 0.000 0.000 threading.py:1134(daemon)
10 0.000 0.000 0.000 0.000 :0(group)
5 0.000 0.000 0.000 0.000 multidict.py:151(__init__)
2 0.000 0.000 0.000 0.000 :0(read)
1 0.000 0.000 0.000 0.000 :0(create_builtin)
10 0.000 0.000 0.000 0.000 :0(b2a_base64)
20 0.000 0.000 0.000 0.000 selectors.py:263(get_map)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:94(acquire)
7 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:852(__enter__)
5 0.000 0.000 0.000 0.000 threading.py:725(_newname)
17 0.000 0.000 0.000 0.000 :0(discard)
10 0.000 0.000 0.000 0.000 client.py:459(__init__)
5 0.000 0.000 0.000 0.000 connector.py:530(_resolve_host)
5 0.000 0.000 0.000 0.000 queue.py:206(_put)
5 0.000 0.000 0.000 0.000 client_reqrep.py:584(_need_parse_response_body)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:74(__init__)
5 0.000 0.000 0.000 0.000 client.py:28(__init__)
5 0.000 0.000 0.000 0.000 futures.py:428(_call_check_cancel)
20 0.000 0.000 0.000 0.000 parse.py:89(_noop)
5 0.000 0.000 0.000 0.000 threading.py:1224(current_thread)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:996(_handle_fromlist)
15 0.000 0.000 0.000 0.000 :0(fileno)
2 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:510(spec_from_file_location)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:119(release)
5 0.000 0.000 0.000 0.000 multidict.py:73(__len__)
5 0.000 0.000 0.000 0.000 :0(getsockopt)
5 0.000 0.000 0.000 0.000 threading.py:246(_release_save)
1 0.000 0.000 0.000 0.000 idna.py:300(getregentry)
15 0.000 0.000 0.000 0.000 cookies.py:505(__init__)
4 0.000 0.000 0.000 0.000 :0(ord)
5 0.000 0.000 0.000 0.000 parsers.py:491(__len__)
4 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:45(_r_long)
15 0.000 0.000 0.000 0.000 base_events.py:369(is_closed)
15 0.000 0.000 0.000 0.000 client_reqrep.py:566(connection)
10 0.000 0.000 0.000 0.000 parsers.py:108(set_transport)
5 0.000 0.000 0.000 0.000 client.py:151(__init__)
5 0.000 0.000 0.000 0.000 thread.py:44(__init__)
10 0.000 0.000 0.000 0.000 futures.py:314(<listcomp>)
5 0.000 0.000 0.000 0.000 :0(unpack_from)
5 0.000 0.000 0.000 0.000 :0(inet_pton)
10 0.000 0.000 0.000 0.000 streams.py:415(feed_eof)
7 0.000 0.000 0.000 0.000 sre_parse.py:226(__next)
1 0.000 0.000 0.000 0.000 sre_parse.py:167(getwidth)
10 0.000 0.000 0.000 0.000 :0(get_coroutine_wrapper)
5 0.000 0.000 0.000 0.000 transports.py:279(_set_write_buffer_limits)
5 0.000 0.000 0.000 0.000 :0(count)
10 0.000 0.000 0.000 0.000 :0(__subclasshook__)
5 0.000 0.000 0.000 0.000 :0(heappop)
12 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:324(<genexpr>)
5 0.000 0.000 0.000 0.000 threading.py:72(RLock)
10 0.000 0.000 0.000 0.000 :0(end)
5 0.000 0.000 0.000 0.000 enum.py:476(__str__)
10 0.000 0.000 0.000 0.000 :0(set_coroutine_wrapper)
4 0.000 0.000 0.000 0.000 :0(min)
5 0.000 0.000 0.000 0.000 websocket.py:279(__init__)
10 0.000 0.000 0.000 0.000 :0(release_lock)
5 0.000 0.000 0.000 0.000 streams.py:148(__init__)
5 0.000 0.000 0.000 0.000 protocol.py:269(__init__)
5 0.000 0.000 0.000 0.000 transports.py:13(__init__)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:419(parent)
10 0.000 0.000 0.000 0.000 threading.py:504(is_set)
6 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:1061(_path_importer_cache)
5 0.000 0.000 0.000 0.000 :0(iter)
1 0.000 0.000 0.000 0.000 sre_parse.py:217(__init__)
5 0.000 0.000 0.000 0.000 client_reqrep.py:211(update_cookies)
5 0.000 0.000 0.000 0.000 streams.py:191(_drain_helper)
5 0.000 0.000 0.000 0.000 unix_events.py:60(_process_self_data)
2 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:379(_check_name_wrapper)
5 0.000 0.000 0.000 0.000 streams.py:175(connection_lost)
5 0.000 0.000 0.000 0.000 streams.py:123(feed_eof)
2 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:789(find_spec)
5 0.000 0.000 0.000 0.000 :0(insert)
5 0.000 0.000 0.000 0.000 base_events.py:1153(_timer_handle_cancelled)
5 0.000 0.000 0.000 0.000 :0(heappush)
5 0.000 0.000 0.000 0.000 client_reqrep.py:246(update_auth)
1 0.000 0.000 0.000 0.000 codecs.py:93(__new__)
5 0.000 0.000 0.000 0.000 threading.py:1118(daemon)
5 0.000 0.000 0.000 0.000 client_reqrep.py:260(update_body_from_data)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:372(__init__)
2 0.000 0.000 0.000 0.000 :0(tolist)
2 0.000 0.000 0.000 0.000 sre_compile.py:513(isstring)
7 0.000 0.000 0.000 0.000 :0(acquire_lock)
6 0.000 0.000 0.000 0.000 sre_parse.py:242(match)
1 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:745(exec_module)
2 0.000 0.000 0.000 0.000 sre_parse.py:276(tell)
5 0.000 0.000 0.000 0.000 :0(gettimeout)
5 0.000 0.000 0.000 0.000 connector.py:249(closed)
5 0.000 0.000 0.000 0.000 base_events.py:383(is_running)
5 0.000 0.000 0.000 0.000 parsers.py:321(__init__)
5 0.000 0.000 0.000 0.000 client.py:435(detach)
2 0.000 0.000 0.000 0.000 :0(is_builtin)
5 0.000 0.000 0.000 0.000 selector_events.py:559(is_closing)
5 0.000 0.000 0.000 0.000 client.py:430(cookies)
2 0.000 0.000 0.000 0.000 sre_parse.py:75(groups)
5 0.000 0.000 0.000 0.000 client.py:52(url)
2 0.000 0.000 0.000 0.000 :0(translate)
5 0.000 0.000 0.000 0.000 _base.py:355(__get_result)
1 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:235(_requires_builtin_wrapper)
5 0.000 0.000 0.000 0.000 parsers.py:116(exception)
6 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:34(_relax_case)
5 0.000 0.000 0.000 0.000 base_events.py:339(stop)
5 0.000 0.000 0.000 0.000 client.py:41(processor)
5 0.000 0.000 0.000 0.000 protocol.py:901(autochunked)
2 0.000 0.000 0.000 0.000 :0(cast)
2 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:35(_new_module)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:314(__enter__)
5 0.000 0.000 0.000 0.000 protocol.py:892(path)
5 0.000 0.000 0.000 0.000 protocol.py:560(version)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:225(_verbose_message)
5 0.000 0.000 0.000 0.000 client.py:66(close)
5 0.000 0.000 0.000 0.000 protocol.py:888(method)
1 0.000 0.000 0.000 0.000 sre_parse.py:797(fix_flags)
5 0.000 0.000 0.000 0.000 connector.py:76(loop)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:310(__init__)
2 0.000 0.000 0.000 0.000 parse.py:360(<genexpr>)
5 0.000 0.000 0.000 0.000 client.py:178(<lambda>)
2 0.000 0.000 0.000 0.000 :0(_fix_co_filename)
4 0.000 0.000 0.000 0.000 :0(isalnum)
1 0.000 0.000 0.000 0.000 :0(compile)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:159(__init__)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:190(cb)
1 0.000 0.000 0.000 0.000 :0(replace)
2 0.000 0.000 0.000 0.000 :0(is_frozen)
1 0.000 0.000 0.000 0.000 sre_parse.py:165(append)
3 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:427(has_location)
1 0.000 0.000 0.000 0.000 queue.py:199(_init)
1 0.000 0.000 0.000 0.000 :0(setattr)
2 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:808(get_filename)
1 0.000 0.000 0.000 0.000 sre_parse.py:70(__init__)
1 0.000 0.000 0.000 0.000 connector.py:146(__del__)
1 0.000 0.000 0.000 0.000 selector_events.py:575(__del__)
2 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:653(create_module)
1 0.000 0.000 0.000 0.000 sre_parse.py:105(__init__)
1 0.000 0.000 0.000 0.000 connector.py:58(__del__)
1 0.000 0.000 0.000 0.000 idna.py:146(Codec)
1 0.000 0.000 0.000 0.000 client_reqrep.py:546(__del__)
1 0.000 0.000 0.000 0.000 :0(exec_builtin)
1 0.000 0.000 0.000 0.000 idna.py:218(IncrementalEncoder)
1 0.000 0.000 0.000 0.000 idna.py:253(IncrementalDecoder)
1 0.000 0.000 0.000 0.000 idna.py:295(StreamReader)
1 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:762(is_package)
1 0.000 0.000 0.000 0.000 idna.py:292(StreamWriter)
0 0.000 0.000 profile:0(profiler)
@davebshow
Copy link
Author

Summary should say: This gist details some simple profiling that I did to compare compare a Tornado based client implementation vs. a Aiohttp based implementation of gremlinclient. To do so, I simply dropped the Aiohttp websocket client in the place of the Tornado client in gremlinclient like shown in the following file. Next I did a simple IPython %timeit, followed by five runs each with a profiler that outputs aggregated stats. Results show bottlenecks in the Aiohttp implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment