[Python-Dev] _socket efficiencies ideas

Guido van Rossum guido@python.org
Wed, 09 Apr 2003 16:05:50 -0400


> Why don't we carry it to the logical conclusion and say that the
> resolver should also avoid doing a forward lookup on an already numeric
> IP?
> 
> I've noticed that before the Red Hat 8.0 release, doing a "telnet <ip>"
> would usually be very fast on the initial connection, and since 8.0 it's
> been slow as if doing a lookup...  To me that indicates that the
> resolver used to do this and has been changed to not, which makes me
> wonder why that was...
> 
> Perhaps we're being too clever and it's going to come back to bite us?

I think it's the other way around.  The resolver lost some perfectly
good caching in the upgrade to support IPv6.  The designers probably
didn't notice the difference because in their own setup, DNS is fast.
I expect the caching will come back eventually.

> The "<numeric>" syntax would allow us to leave
> resolution as it is and let the user override it when they deem
> necessary.  If we try to auto-detect (which I'm usually all for), we
> should probably implement a "<forcedns>" or similar?

YAGNI.

--Guido van Rossum (home page: http://www.python.org/~guido/)