This MR aligns the uvloop code to become compatible, not production
ready, with PY37 adding the following changes:
* Support for the new API used behind the set_debug function.
* Adds the context=None KW to those functions that will receive it
when uvloop runs with PY37.
* Former asyncio.test_utils moved as an uvloop test resource.
--
Yury: the original PR for this change is #138. I stripped out
all the CI bits and squashed all commits by hand. The CI
will be addressed later.
Instead of making a `write` syscall on each `transport.write`
call, we now have an internal buffer of queued write calls.
After all callbacks are done, or after the selector poll is
complete, we flush the buffers using as low number of syscalls
as possible.
We now use zero-copy aggressively. For instance, writelines
doesn't concat all buffers into one bytes object; instead each
buffer passed to writelines will be repackaged and passed to
the writev syscall (along with all other buffered data).
This commit (+ 2 before this one) completes the refactoring
of transport writes. Sequential writes of small buffers are now
~3x faster. For instance: transport.write 15360 buffers by
0.01 MB:
- before: 0.32 seconds (466.87 MB/sec)
- after: 0.09 seconds (1657.38 MB/sec)