1. 15 Apr, 2018 6 commits
    • Jason Madden's avatar
      Add benchmark for using subprocess.Popen to create /usr/bin/true [skip ci] · b166aaf8
      Jason Madden authored
      In response to #1172
      
      The following numbers are for my machine on macOS 10.13.3 with MAXFD
      of 50000.
      
      Python 2.7:
      
      .....................
      spawn native no close_fds: Mean +- std dev: 1.81 ms +- 0.04 ms
      .....................
      spawn gevent no close_fds: Mean +- std dev: 2.11 ms +- 0.08 ms
      .....................
      spawn native close_fds: Mean +- std dev: 31.0 ms +- 0.7 ms
      .....................
      spawn gevent close_fds: Mean +- std dev: 31.6 ms +- 0.6 ms
      
      Notice that the times when close_fd=True (not the default on 2.7) are
      about the same. 2.7 uses the same Python loop we do to close all the
      fds.
      
      Now 3.7:
      
      .....................
      spawn native no close_fds: Mean +- std dev: 1.34 ms +- 0.04 ms
      .....................
      spawn gevent no close_fds: Mean +- std dev: 117 ms +- 2 ms
      .....................
      spawn native close_fds: Mean +- std dev: 1.36 ms +- 0.03 ms
      .....................
      spawn gevent close_fds: Mean +- std dev: 32.5 ms +- 0.4 ms
      
      Notice that gevent is *much* slower when we *don't* close the fds.
      This is because, starting in Python 3.4, close_fds defaults to true,
      and when it's false we have to check os.get_inheritable() for each fd
      before we close it. gevent performs the same as it did on Python 2.7
      when closing fds, but the native implementation is much faster due to
      the C optimizations outlined in #1172---it turns out they apply to BSD
      and Apple platforms in addition to Linux, although they're not async
      safe.
      
      Now, the C code does the opposite for inheritable handles: it
      explicitly calls make_inheritable() for the ones it wants to keep and
      lets the OS close the others with CLOEXEC. We could probably do that
      too; the slow down for this case counts as a regression, I think.
      b166aaf8
    • Jason Madden's avatar
      Reorganize docs. · b7c9a1df
      Jason Madden authored
      Move the API reference to its own (sectioned) page to clean up the main page. Break up the massive 'gevent' module page into more digestable parts and add more xrefs.
      b7c9a1df
    • Jason Madden's avatar
    • Jason Madden's avatar
    • Jason Madden's avatar
    • Jason Madden's avatar
      Merge pull request #1174 from gevent/cffi-win · e2aef582
      Jason Madden authored
      Use environment markers to install CFFI on windows so the libuv backend can really be default
      e2aef582
  2. 14 Apr, 2018 7 commits
  3. 13 Apr, 2018 3 commits
  4. 10 Apr, 2018 1 commit
  5. 09 Apr, 2018 1 commit
  6. 03 Apr, 2018 1 commit
  7. 02 Apr, 2018 1 commit
  8. 31 Mar, 2018 3 commits
  9. 30 Mar, 2018 8 commits
  10. 29 Mar, 2018 1 commit
  11. 27 Mar, 2018 3 commits
    • Jason Madden's avatar
      Working on some more socket benchmarks · 840692b0
      Jason Madden authored
      The good news is that current master is about 10-15% faster for
      sendall than 1.2.2 was (e.g., 301ws vs 256ms in Python 3.6). udp
      sendto is roughly unaffected (within the margins, based on the native
      performance). Moving the chunking implementation of sendall to Cython
      doesn't show any improvements (so that's not a bottleneck, at least in
      these benchmarks).
      
      The "bad" news is that both UDP and (especially) sendall perform much
      worse than native (native does about 47ms for sendall). This is
      probably related to the fact that we're doing everything in one
      process and one thread, and it is CPU bound; the native process can
      use 150% CPU or so, but the gevent version cannot. So the comparison
      is not directly meaningful.
      
      [skip ci]
      840692b0
    • Jason Madden's avatar
      Merge pull request #1156 from gevent/cython-waiter · 62802671
      Jason Madden authored
      Compile the important hub operations that use Waiters with Cython
      62802671
    • Jason Madden's avatar
      Attempt to fix test__backdoor.py · a4fbd046
      Jason Madden authored
      a4fbd046
  12. 26 Mar, 2018 4 commits
    • Jason Madden's avatar
    • Jason Madden's avatar
      Compile the hub operations that use Waiters with Cython · 92b1a6b6
      Jason Madden authored
      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%) |
      92b1a6b6
    • Jason Madden's avatar
      Merge pull request #1155 from gevent/cython-waiter · 821e7fc8
      Jason Madden authored
      Compile gevent.queue and gevent.hub.waiter with Cython
      821e7fc8
    • Jason Madden's avatar
      Greenlet can cimport waiter. · 870e8e13
      Jason Madden authored
      870e8e13
  13. 25 Mar, 2018 1 commit