> "Tim Peters" <tim.one@home.com> writes: > > > [Guido, on reworking select()] > > > Yes, I think we do need this. PyObject_AsFileDescriptor() calls the > > > fileno() method which could be a Python call. > > > > Ya, but for me to believe that *matters*, I have to believe people worried > > about high-performance select are passing objects with Python-implemented > > fileno methods to begin with. That's quite a stretch, isn't it? They have > > to pay for fileno() calls regardless, the question is only whether they pay > > it once or twice per object. [And Tim posted an interesting alternative implementation] That looks like a good way to avoid the double fileno() calls. Drawback: the implementation you sketched seems to create a twople per file descriptor. That's not quite a malloc (twoples are cached), but still. If someone feels like implementing this, please go ahead! [MH] > Posted admittedly without checking any facts: > > (1) Doesn't the Python fileno() method issue leave you open to > ridiculous fileno() methods that mutate the list passed in to > select()? Yes, but the select code is immune to that -- it may get an exception but it correctly propagates those. > (2) AIUI, if you really care about performance you should be using > poll() anyway (tho' obviously this depends on your platform having > poll() in the first place, and I don't have the faintest idea how > widespread it is). Very widespread. I forget -- what's the reason for poll()'s claim to better performance? --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4