[Python-Dev] _socket efficiencies ideas

Jack Jansen Jack.Jansen@oratrix.com
Wed, 9 Apr 2003 23:33:14 +0200


On woensdag, apr 9, 2003, at 16:40 Europe/Amsterdam, Sean Reifschneider 
wrote:

> On Thu, Apr 10, 2003 at 12:24:45AM +1000, Anthony Baxter wrote:
>> Ick ick. This is putting a bunch of code for a stub resolver into 
>> python.
>> This stuff is hard to get right - I implemented this on top of pydns, 
>> and
>> it was a lot of work to get (what I think is) correct, for not very 
>> much
>> gain.
>
> Well, ideally you'd cache the data for as long as the SOA says to cache
> it.  However, it sounds like in the situation that started this thread,
> even caching that data for some small but configurable number of 
> seconds
> might help out.

I wouldn't touch caching with a ten foot pole here: Python cannot know 
what happens
under the hood of the network. For example, if I move my WiFi-equipped 
laptop
from one location to another I don't want to be forced to restart my 
Python
applications just to clear some silly cache, knowing that the OS and 
libc
layers have handled the switch fine.

(And, yes, Windoze-users are probably required to reboot anyway, but my 
Mac
handles changing IP addresses just nicely:-)
--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma 
Goldman -