New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile the important hub operations that use Waiters with Cython #1156

Merged
merged 3 commits into from Mar 27, 2018

Conversation

Projects
None yet
1 participant
@jamadden
Member

jamadden commented Mar 27, 2018

Since we've come this far, might as well keep taking advantage of the
effort...

There are substantial improvements on the micro benchmarks for things
that wait and switch:

Benchmark 27_hub_master2 27_hub_cython5
multiple wait ready 1.96 us 1.10 us: 1.77x faster (-44%)
wait ready 1.47 us 897 ns: 1.64x faster (-39%)
cancel wait 2.93 us 1.81 us: 1.61x faster (-38%)
switch 2.33 us 1.94 us: 1.20x faster (-17%)
Benchmark 36_hub_master2 36_hub_cython6
multiple wait ready 1.28 us 820 ns: 1.56x faster (-36%)
wait ready 939 ns 722 ns: 1.30x faster (-23%)
cancel wait 1.76 us 1.37 us: 1.29x faster (-23%)
switch 1.60 us 1.35 us: 1.18x faster (-16%)

Also let the sockets go directly to using these wait operations. This appears to show a 2-3% improvement in bench_sendall.py, but that's a terrible benchmark for this sort of thing. (I'm working on a better benchmark.)

jamadden added some commits Mar 26, 2018

Compile the hub operations that use Waiters with Cython
Since we've come this far, might as well keep taking advantage of the
effort...

There are substantial improvements on the micro benchmarks for things
that wait and switch:

| Benchmark           | 27_hub_master2 | 27_hub_cython5               |
|---------------------|----------------|------------------------------|
| multiple wait ready | 1.96 us        | 1.10 us: 1.77x faster (-44%) |
| wait ready          | 1.47 us        | 897 ns: 1.64x faster (-39%)  |
| cancel wait         | 2.93 us        | 1.81 us: 1.61x faster (-38%) |
| switch              | 2.33 us        | 1.94 us: 1.20x faster (-17%) |

| Benchmark           | 36_hub_master2 | 36_hub_cython6 |
|---------------------|----------------|------------------------------|
| multiple wait ready | 1.28 us        | 820 ns: 1.56x faster (-36%)  |
| wait ready          | 939 ns         | 722 ns: 1.30x faster (-23%)  |
| cancel wait         | 1.76 us        | 1.37 us: 1.29x faster (-23%) |
| switch              | 1.60 us        | 1.35 us: 1.18x faster (-16%) |
@jamadden

This comment has been minimized.

Member

jamadden commented Mar 27, 2018

Sigh. GEVENT_DEBUG=debug GEVENT_LOOP=libuv GEVENT_RESOLVER=thread GEVENT_RESOLVER_NAMESERVERS=8.8.8.8 python2.7.14 test__backdoor.py is failing with signal 11 (segfault) on Travis. I can't reproduce locally on macOS. Appveyor all passed...but that test is skipped on appveyor.

@jamadden

This comment has been minimized.

Member

jamadden commented Mar 27, 2018

I can't reproduce it either on a local Ubuntu VM.

@jamadden jamadden merged commit 6280267 into master Mar 27, 2018

5 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.3%) to 84.447%
Details

@jamadden jamadden deleted the cython-waiter branch Mar 27, 2018

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