Name: rmT116609 Date: 09/29/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
It can take up to 20-25 seconds to make the hash code of a single URL!
This value seems to be cached for additional hashes of different URL objects
with the same value. This is also true for the URL equals() method. The time
varies a lot depending on the particular URL.
I assume that this is because the URL actually tries to lookup the host on the
network, and caches that result??? If so, this should be documented in the API!
Simple test:
URL url = new URL("http://www.guitarsphere.com");
Date start = new Date();
int hashCode = url.hashCode();
Date end = new Date();
System.out.println( "Time to make hash code: " +
(end.getTime()-start.getTime()));
(Review ID: 110066)
======================================================================