This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author socketpair
Recipients socketpair
Date 2011-02-21.15:49:14
SpamBayes Score 3.401686e-07
Marked as misclassified No
Message-id <1298303363.56.0.939143119689.issue11273@psf.upfronthosting.co.za>
In-reply-to
Content
select.poll() object or r,w,e arrays for select() should not be built from the start in each iteration.

For performance issue, such objects should be created in loop() function and modified in add_channel/del_channel. As we do not know, what type of event loop (select or poll) will be choosed, we must either build both (bad performance anyway) or create new class:

1. new class a-la "poller" should be created, accepting "map" and "use_poll" parameters. poll() should be moved to poller.poll()
2. The "dispatcher" class should accept "poller" as parameter (not just "map")
3. "add_channel" and "del_channel" should add/remove items in "poller" (select.poll.modify or list.remove for r,w,e)
4. "poller" should have weakref to each controlled "dispatcher" just for unregistering dead dispatchers via weakref callback.

I can create a patch, but will not start until someone approve my idea.
History
Date User Action Args
2011-02-21 15:49:23socketpairsetrecipients: + socketpair
2011-02-21 15:49:23socketpairsetmessageid: <1298303363.56.0.939143119689.issue11273@psf.upfronthosting.co.za>
2011-02-21 15:49:14socketpairlinkissue11273 messages
2011-02-21 15:49:14socketpaircreate