I've been trying to fetch some content from a Url. My machine is behind a proxy server. The first method I tried was using the System.setProperty calls to set the details of the proxy server. This worked well.

The second method was to set the values in the java.net.Proxy object and use it while calling url.openConnection. This method turned out to be about 3 seconds slower.

Does anyone have an explanation for the discrepancy in performance.