Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pyperformance/benchmarks/bm_tornado_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
data as a HTTP response's body.
"""

import sys
import socket

from six.moves import xrange
Expand Down Expand Up @@ -86,6 +87,16 @@ def run_client():


if __name__ == "__main__":
# 3.8 changed the default event loop to ProactorEventLoop which doesn't
# implement everything required by tornado and breaks this benchmark.
# Restore the old WindowsSelectorEventLoop default for now.
# https://bugs.python.org/issue37373
# https://github.com/python/pyperformance/issues/61
# https://github.com/tornadoweb/tornado/pull/2686
Comment thread
lazka marked this conversation as resolved.
Resolved
Comment thread
lazka marked this conversation as resolved.
Resolved
if sys.platform == 'win32' and sys.version_info[:2] == (3, 8):
import asyncio
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

kw = {}
if pyperf.python_has_jit():
# PyPy needs to compute more warmup values to warmup its JIT
Expand Down