Message173218
> Do you mean at the C level?
No, Python of course.
> poll(), unlike select(), does not have to scan an fd_set
> (of 1024 bits?) so I would have expected it to be faster if anything.
That might be true in a continuous loop (e.g. a reactor).
Judging from where this is supposed to take place (http://hg.python.org/cpython/file/f6fcff683866/Lib/multiprocessing/connection.py#l865) what you would end up doing within the wait() function is:
- init_pollster()
- register(fd) * num of fds
- unregister(fd) * num of fds
- close_pollster()
...and I suspect that's likely to be slower than just using select(), even if you cache the poll object. Anyway, I might be wrong, and figuring that out with a simple benchmark is easy.
Other than that I'm not sure how often wait() gets called usually so even if a slowdown is introduced that might not even be a problem. |
|
Date |
User |
Action |
Args |
2012-10-18 00:03:50 | giampaolo.rodola | set | recipients:
+ giampaolo.rodola, sbt, William.Edwards |
2012-10-18 00:03:50 | giampaolo.rodola | set | messageid: <1350518630.23.0.779040172532.issue16269@psf.upfronthosting.co.za> |
2012-10-18 00:03:50 | giampaolo.rodola | link | issue16269 messages |
2012-10-18 00:03:50 | giampaolo.rodola | create | |
|