Skip to content
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

use epoll on linux #9

Open
pjz opened this issue Mar 25, 2016 · 3 comments
Open

use epoll on linux #9

pjz opened this issue Mar 25, 2016 · 3 comments

Comments

@pjz
Copy link
Contributor

pjz commented Mar 25, 2016

select.select() is significantly slower on linux than select.epoll(), so, especially in the case of network services, there's a huge performance gain in using epoll.

I see a few ways forward:

  1. declare it WontFix.
  2. abstract the filehandle-watching so it can be switched based on what OS is running
  3. find/use something like libevent() which does the abstraction for you
  4. make completely different SystemBases - one for select(), one for epoll()
@kwquick
Copy link
Contributor

kwquick commented Mar 25, 2016

I agree that select() is generally the least-performant approach. It is the currently implemented form because it is also the most broadly portable (for both operating systems and python versions).

In reference to #3 in your list, Python has the "selectables" in the standard library, but this was only introduced in 3.4.

Right now, Thespian supports all versions of Python from 2.6 through 3.5 by taking the "common path" as much as possible. This is definitely a performance issue that should be addressed at some point, so I'm not going to take method 1 (WontFix), and I would prefer to provide internal adaptation and avoid a proliferation of SystemBases (i.e. your method 2 as preference to method 4). If there is too much variation or there is a need for externally-supplied configuration, it may be necessary to introduce a new SystemBase but in general I would prefer to internalize the complexity to keep the Actor usage simple.

Keeping this as an open enhancement request to flag this for future performance work.

@pjz
Copy link
Contributor Author

pjz commented Mar 28, 2016

By "selectables" do you mean selectors ? If so, the selectors34 package provides a forward-compatible version for python 2.6, 2.7 and 3.3... perhaps that's the correct way forward? (Also, thanks for bringing that to my attention, I hadn't seen it before!)

@ysangkok
Copy link

another option would be just to use asyncio?

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

No branches or pull requests

3 participants