Re: URLStreamHandler.getHostAddress() performance

2014-11-27 Thread Pavel Rappo
Peter, thanks a lot for the link and such a detailed explanation. I've been working with URL/URLStreamHandler recently to make them "modularization ready" and have noticed some of the problems you were talking about as well. I do think we should make our best effort to fix it. Give me some time

Re: URLStreamHandler.getHostAddress() performance

2014-11-27 Thread Pavel Rappo
> On 25 Nov 2014, at 14:03, Mark Sheppard wrote: > > I think this raises a more fundamental question, as to why the URL > hashCode() and equals() methods delegates to URLStreamHandler > in the first place? rather than performing the processing within the URL > class itself, and synchroniz

Re: URLStreamHandler.getHostAddress() performance

2014-11-27 Thread Peter Levart
Hi, Some time ago I dived into the sinchronization pitfalls of URL / URLStreamHandler and came up with a possible solution. Here's the thread (mostly just my comments) and a patch: http://mail.openjdk.java.net/pipermail/net-dev/2014-July/008592.html Regards, Peter On 11/25/2014 03:03 PM, Ma

Re: URLStreamHandler.getHostAddress() performance

2014-11-25 Thread Mark Sheppard
I think this raises a more fundamental question, as to why the URL hashCode() and equals() methods delegates to URLStreamHandler in the first place? rather than performing the processing within the URL class itself, and synchronizing appropriately within. If you call equals() and hasCode()

Re: URLStreamHandler.getHostAddress() performance

2014-11-25 Thread Pavel Rappo
Max, this change dates back to 99/06/11. And there's not much info left on it. I suggest changing and running the full test suit. P.S. I assume the whole synchronization burden in the URL comes from lazy initialization of hostAddress and lazy computation of the hashCode (...and access to shared

Re: URLStreamHandler.getHostAddress() performance

2014-11-25 Thread Wang Weijun
> On Nov 25, 2014, at 20:25, Pavel Rappo wrote: > > Hi Max, > > I don't see any particular reason for this. Maybe it's just a "precaution". > It seems to me it's the only field > of the URL class set directly (without setter) from an outside. > > Does it hurt performance a lot? In what cases?

Re: URLStreamHandler.getHostAddress() performance

2014-11-25 Thread Pavel Rappo
Hi Max, I don't see any particular reason for this. Maybe it's just a "precaution". It seems to me it's the only field of the URL class set directly (without setter) from an outside. Does it hurt performance a lot? In what cases? -Pavel > On 25 Nov 2014, at 12:02, Wang Weijun wrote: > > I am