Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
URL often are used as keys for hashtables. E.g. see 6754990. Same is applicable to deployment cache, etc. If nothing is really download from the network then DNS lookups are one of most expensive operations that may happen. Especially if DNS access is slow. Proposed solution is: 1) for hashcode() use only file/protocol/port unless file portion is really short In later case use host inet address too 2) for hostEquals() - first check string representations and if they match then do not perform DNS lookup This version of hashcode() will still obey hashcode()/equals() contract. It will increase hashcode coincidence in some cases (if file paths are the same). But there are only few patterns when this may happen (e.g. root page of the site) and we can workaround some of them using minimal requirement on length of file portion. See suggested fix for details.
|