You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Sandro Martini (JIRA)" <ji...@apache.org> on 2009/05/28 15:19:45 UTC
[jira] Created: (PIVOT-132) pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
-------------------------------------------------------------------------------------------------------------------------------------------------
Key: PIVOT-132
URL: https://issues.apache.org/jira/browse/PIVOT-132
Project: Pivot
Issue Type: Improvement
Components: wtk
Affects Versions: 1.1, 1.2
Reporter: Sandro Martini
Assignee: Greg Brown
Priority: Minor
As from the latest FindBugs, this warning (with High Priority) in hilited:
pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
And from their doc related to this:
This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit.
See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information.
Consider using java.net.URI instead.
Trying to change URL with URI is ok here, but given compilation error in approx. 24 classes related to this.
Needs further study.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (PIVOT-132)
pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761156#action_12761156 ]
Sandro Martini commented on PIVOT-132:
--------------------------------------
One more sample:
http://www.willianmitsuda.com/2008/03/03/javaneturl-is-evil/
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: PIVOT-132
> URL: https://issues.apache.org/jira/browse/PIVOT-132
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 1.1, 1.2
> Reporter: Sandro Martini
> Assignee: Greg Brown
> Priority: Minor
> Fix For: 1.5
>
>
> As from the latest FindBugs, this warning (with High Priority) in hilited:
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> And from their doc related to this:
> This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit.
> See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information.
> Consider using java.net.URI instead.
> Trying to change URL with URI is ok here, but given compilation error in approx. 24 classes related to this.
> Needs further study.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (PIVOT-132)
pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761155#action_12761155 ]
Sandro Martini commented on PIVOT-132:
--------------------------------------
resourceCache is a Map with URL as keys, but and seen in many articles i think it would be better to use URI as keys instead.
For example, see here: http://java.sun.com/j2se/1.5.0/docs/api/java/net/URL.html
> Note, the URI class does perform escaping of its component fields in certain circumstances. The recommended way to manage the encoding and decoding of URLs is to use URI, and to convert between these two classes using toURI() and URI.toURL().
I can start to do the work (for the 1.4 release), but many wtk classes needs this little change.
Comments ?
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: PIVOT-132
> URL: https://issues.apache.org/jira/browse/PIVOT-132
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 1.1, 1.2
> Reporter: Sandro Martini
> Assignee: Greg Brown
> Priority: Minor
> Fix For: 1.5
>
>
> As from the latest FindBugs, this warning (with High Priority) in hilited:
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> And from their doc related to this:
> This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit.
> See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information.
> Consider using java.net.URI instead.
> Trying to change URL with URI is ok here, but given compilation error in approx. 24 classes related to this.
> Needs further study.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (PIVOT-132) pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-132?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Greg Brown updated PIVOT-132:
-----------------------------
Fix Version/s: (was: 1.3)
1.4
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: PIVOT-132
> URL: https://issues.apache.org/jira/browse/PIVOT-132
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 1.1, 1.2
> Reporter: Sandro Martini
> Assignee: Greg Brown
> Priority: Minor
> Fix For: 1.4
>
>
> As from the latest FindBugs, this warning (with High Priority) in hilited:
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> And from their doc related to this:
> This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit.
> See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information.
> Consider using java.net.URI instead.
> Trying to change URL with URI is ok here, but given compilation error in approx. 24 classes related to this.
> Needs further study.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (PIVOT-132)
pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by "Todd Volkert (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761177#action_12761177 ]
Todd Volkert commented on PIVOT-132:
------------------------------------
You're always free to work on any ticket, but my 2c is that 1.4 tickets would be better served. We use the source cache so infrequently in code that this is not likely to hurt the application more than a few milliseconds. But then again, maybe I'm wrong -- perhaps you could start by profiling our calls to the resource cache to see how big a hit we're taking?
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: PIVOT-132
> URL: https://issues.apache.org/jira/browse/PIVOT-132
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 1.1, 1.2
> Reporter: Sandro Martini
> Assignee: Greg Brown
> Priority: Minor
> Fix For: 1.5
>
>
> As from the latest FindBugs, this warning (with High Priority) in hilited:
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> And from their doc related to this:
> This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit.
> See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information.
> Consider using java.net.URI instead.
> Trying to change URL with URI is ok here, but given compilation error in approx. 24 classes related to this.
> Needs further study.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (PIVOT-132)
pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761219#action_12761219 ]
Greg Brown commented on PIVOT-132:
----------------------------------
Agreed - this is a pretty low-priority issue, and the impact of changing this API is far-reaching. We have a lot of other issues that are already assigned to 1.4 and 1.4.1 that would be more useful, if you have time to work on them.
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: PIVOT-132
> URL: https://issues.apache.org/jira/browse/PIVOT-132
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 1.1, 1.2
> Reporter: Sandro Martini
> Assignee: Greg Brown
> Priority: Minor
> Fix For: 1.5
>
>
> As from the latest FindBugs, this warning (with High Priority) in hilited:
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> And from their doc related to this:
> This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit.
> See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information.
> Consider using java.net.URI instead.
> Trying to change URL with URI is ok here, but given compilation error in approx. 24 classes related to this.
> Needs further study.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (PIVOT-132)
pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12749811#action_12749811 ]
Sandro Martini commented on PIVOT-132:
--------------------------------------
Probably some useful tests are to run a sample application (like the Kitchen Sink) under a profiler, and try to see instead of maps with <URL, ...> if using <String, ...> or maybe a <URI, ...> gives performance boost.
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: PIVOT-132
> URL: https://issues.apache.org/jira/browse/PIVOT-132
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 1.1, 1.2
> Reporter: Sandro Martini
> Assignee: Greg Brown
> Priority: Minor
> Fix For: 1.4
>
>
> As from the latest FindBugs, this warning (with High Priority) in hilited:
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> And from their doc related to this:
> This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit.
> See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information.
> Consider using java.net.URI instead.
> Trying to change URL with URI is ok here, but given compilation error in approx. 24 classes related to this.
> Needs further study.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (PIVOT-132)
pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738232#action_12738232 ]
Sandro Martini commented on PIVOT-132:
--------------------------------------
Hi,
we are making a lot of changes for the 1.3 release, and given that i have this marked as an High Priority Bug, wouldn't it be better to make also this change (to the Pivot API) for the 1.3 Release ?
I'm available to help on this.
Sandro
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: PIVOT-132
> URL: https://issues.apache.org/jira/browse/PIVOT-132
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 1.1, 1.2
> Reporter: Sandro Martini
> Assignee: Greg Brown
> Priority: Minor
> Fix For: 1.4
>
>
> As from the latest FindBugs, this warning (with High Priority) in hilited:
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> And from their doc related to this:
> This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit.
> See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information.
> Consider using java.net.URI instead.
> Trying to change URL with URI is ok here, but given compilation error in approx. 24 classes related to this.
> Needs further study.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (PIVOT-132) pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-132?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sandro Martini updated PIVOT-132:
---------------------------------
Fix Version/s: 1.3
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: PIVOT-132
> URL: https://issues.apache.org/jira/browse/PIVOT-132
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 1.1, 1.2
> Reporter: Sandro Martini
> Assignee: Greg Brown
> Priority: Minor
> Fix For: 1.3
>
>
> As from the latest FindBugs, this warning (with High Priority) in hilited:
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> And from their doc related to this:
> This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit.
> See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information.
> Consider using java.net.URI instead.
> Trying to change URL with URI is ok here, but given compilation error in approx. 24 classes related to this.
> Needs further study.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
Re: [jira] Commented: (PIVOT-132) pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by Sandro Martini <sa...@gmail.com>.
Ok, thanks.
So if now Noel or Greg want to take (and close) the related issue on
JIRA ... but assigning it to the 1.4 .
Thanks again,
Sandro
Re: [jira] Commented: (PIVOT-132)
pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by Greg Brown <gk...@mac.com>.
OK, I will update ApplicationContext. Thanks.
On Oct 16, 2009, at 9:13 AM, Noel Grandin wrote:
> Hi
>
> Checked in fix to ImageView.
>
> -- Noel.
>
> Sandro Martini wrote:
>> Hi to all,
>> happy that now we are ready to fix it :-) ... I think it would be
>> better to URI, so we can be more sure that objects passed are valid
>> (String could not be, for strange reasons), and in this way we can
>> avoid toString() calls with maybe performance implications ...
>>
>> Noel, if you want, apply the patch to ImageView, or if not tell me
>> and
>> I'll do it.
>> For other classes I'll find time next week, but if someone has time
>> before be free to do, for me it's not a problem :-) .
>>
>>
>> Thanks to all,
>> Sandro
>>
>
Re: [jira] Commented: (PIVOT-132) pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by Noel Grandin <no...@gmail.com>.
Hi
Checked in fix to ImageView.
-- Noel.
Sandro Martini wrote:
> Hi to all,
> happy that now we are ready to fix it :-) ... I think it would be
> better to URI, so we can be more sure that objects passed are valid
> (String could not be, for strange reasons), and in this way we can
> avoid toString() calls with maybe performance implications ...
>
> Noel, if you want, apply the patch to ImageView, or if not tell me and
> I'll do it.
> For other classes I'll find time next week, but if someone has time
> before be free to do, for me it's not a problem :-) .
>
>
> Thanks to all,
> Sandro
>
Re: [jira] Commented: (PIVOT-132)
pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by Greg Brown <gk...@mac.com>.
> happy that now we are ready to fix it :-) ... I think it would be
> better to URI, so we can be more sure that objects passed are valid
> (String could not be, for strange reasons), and in this way we can
> avoid toString() calls with maybe performance implications ...
The API would still take a URL. We'd just use Strings or URIs
internally. But I'm OK with either one.
Re: [jira] Commented: (PIVOT-132) pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by Sandro Martini <sa...@gmail.com>.
Hi to all,
happy that now we are ready to fix it :-) ... I think it would be
better to URI, so we can be more sure that objects passed are valid
(String could not be, for strange reasons), and in this way we can
avoid toString() calls with maybe performance implications ...
Noel, if you want, apply the patch to ImageView, or if not tell me and
I'll do it.
For other classes I'll find time next week, but if someone has time
before be free to do, for me it's not a problem :-) .
Thanks to all,
Sandro
Re: [jira] Commented: (PIVOT-132)
pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by Greg Brown <gk...@mac.com>.
OK. Then the fix to ImageView should be pretty straightforward - just
convert the URL to a String or URI before using it as a key. The fix
to ApplicationContext.ResourceCacheDictionary should also be
straightforward. We'll need to create a custom iterator that can
convert the internal representation back to a URL, but this is a very
minor issue.
On Oct 16, 2009, at 8:55 AM, Noel Grandin wrote:
>
> Having looked at java.net.URI's equals() method, I would think that
> converting to URI would be safer - some parts of the syntax should be
> compared case-insensitive, while other parts are case-sensitive.
>
> But that's probably a pretty baroque corner case, in real life, it
> won't
> make much difference.
>
> -- Noel.
>
> Greg Brown wrote:
>> Yeah, after reading that article I agree. The article suggests using
>> toString() rather than converting it to a URI - any pros/cons?
>>
>
Re: [jira] Commented: (PIVOT-132) pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by Noel Grandin <no...@gmail.com>.
Having looked at java.net.URI's equals() method, I would think that
converting to URI would be safer - some parts of the syntax should be
compared case-insensitive, while other parts are case-sensitive.
But that's probably a pretty baroque corner case, in real life, it won't
make much difference.
-- Noel.
Greg Brown wrote:
> Yeah, after reading that article I agree. The article suggests using
> toString() rather than converting it to a URI - any pros/cons?
>
Re: [jira] Commented: (PIVOT-132)
pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by Greg Brown <gk...@mac.com>.
Yeah, after reading that article I agree. The article suggests using
toString() rather than converting it to a URI - any pros/cons?
On Oct 16, 2009, at 8:33 AM, Todd Volkert wrote:
> http://daniel.gredler.net/2008/04/24/urlhashcode-considered-harmful/
> I disagree that we should wait on this if we have a fix in hand.
> Tiggering
> DNS lookups upon hashCode()?? That's poor...
>
> -T
>
> On Fri, Oct 16, 2009 at 8:21 AM, Greg Brown <gk...@mac.com> wrote:
>
>> This seems like a reasonable fix, but I would personally prefer to
>> leave
>> this issue assigned to the 1.5 release and address it then, if
>> necessary (we
>> have not noticed any adverse effects from the current
>> implementation so it
>> may not be worth changing).
>>
>>
>> On Oct 16, 2009, at 6:06 AM, Sandro Martini wrote:
>>
>> Hi Noel,
>>> thanks for the patch ... but what say others on this ?
>>>
>>> I (or you, no problem :-) ) could start applying it only to
>>> ImageView,
>>> and see if all is good (no doubt it will be right), and then (maybe
>>> later) make the same for all other classes (but there are many),
>>> ok ?
>>>
>>> Bye,
>>> Sandro
>>>
>>
>>
Re: [jira] Commented: (PIVOT-132) pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by Todd Volkert <tv...@gmail.com>.
http://daniel.gredler.net/2008/04/24/urlhashcode-considered-harmful/
I disagree that we should wait on this if we have a fix in hand. Tiggering
DNS lookups upon hashCode()?? That's poor...
-T
On Fri, Oct 16, 2009 at 8:21 AM, Greg Brown <gk...@mac.com> wrote:
> This seems like a reasonable fix, but I would personally prefer to leave
> this issue assigned to the 1.5 release and address it then, if necessary (we
> have not noticed any adverse effects from the current implementation so it
> may not be worth changing).
>
>
> On Oct 16, 2009, at 6:06 AM, Sandro Martini wrote:
>
> Hi Noel,
>> thanks for the patch ... but what say others on this ?
>>
>> I (or you, no problem :-) ) could start applying it only to ImageView,
>> and see if all is good (no doubt it will be right), and then (maybe
>> later) make the same for all other classes (but there are many), ok ?
>>
>> Bye,
>> Sandro
>>
>
>
Re: [jira] Commented: (PIVOT-132)
pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by Greg Brown <gk...@mac.com>.
This seems like a reasonable fix, but I would personally prefer to
leave this issue assigned to the 1.5 release and address it then, if
necessary (we have not noticed any adverse effects from the current
implementation so it may not be worth changing).
On Oct 16, 2009, at 6:06 AM, Sandro Martini wrote:
> Hi Noel,
> thanks for the patch ... but what say others on this ?
>
> I (or you, no problem :-) ) could start applying it only to ImageView,
> and see if all is good (no doubt it will be right), and then (maybe
> later) make the same for all other classes (but there are many), ok ?
>
> Bye,
> Sandro
Re: [jira] Commented: (PIVOT-132) pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by Sandro Martini <sa...@gmail.com>.
Hi Noel,
thanks for the patch ... but what say others on this ?
I (or you, no problem :-) ) could start applying it only to ImageView,
and see if all is good (no doubt it will be right), and then (maybe
later) make the same for all other classes (but there are many), ok ?
Bye,
Sandro
Re: [jira] Commented: (PIVOT-132) pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by Noel Grandin <no...@gmail.com>.
Sandro, you don't need to change the API.
You need something like the attached patch.
Sandro Martini (JIRA) wrote:
> [ https://issues.apache.org/jira/browse/PIVOT-132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12766461#action_12766461 ]
>
> Sandro Martini commented on PIVOT-132:
> --------------------------------------
>
> Now the same problem happens on ImageView class, this is the detail:
>
> ApplicationContext.java:1444 org.apache.pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> ImageView.java:69 org.apache.pivot.wtk.ImageView.loadMap is or uses a map or set of URLs, which can be a performance hog
>
> Other the performance side of this (that probably for is is not a real problem), I'll make some tests to ensure if this is really a bad practice.
>
>
>
>> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
>> -------------------------------------------------------------------------------------------------------------------------------------------------
>>
>> Key: PIVOT-132
>> URL: https://issues.apache.org/jira/browse/PIVOT-132
>> Project: Pivot
>> Issue Type: Improvement
>> Components: wtk
>> Affects Versions: 1.1, 1.2
>> Reporter: Sandro Martini
>> Assignee: Greg Brown
>> Priority: Minor
>> Fix For: 1.5
>>
>>
>> As from the latest FindBugs, this warning (with High Priority) in hilited:
>> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
>> And from their doc related to this:
>> This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit.
>> See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information.
>> Consider using java.net.URI instead.
>> Trying to change URL with URI is ok here, but given compilation error in approx. 24 classes related to this.
>> Needs further study.
>>
>
>
[jira] Commented: (PIVOT-132)
pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12766461#action_12766461 ]
Sandro Martini commented on PIVOT-132:
--------------------------------------
Now the same problem happens on ImageView class, this is the detail:
ApplicationContext.java:1444 org.apache.pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
ImageView.java:69 org.apache.pivot.wtk.ImageView.loadMap is or uses a map or set of URLs, which can be a performance hog
Other the performance side of this (that probably for is is not a real problem), I'll make some tests to ensure if this is really a bad practice.
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: PIVOT-132
> URL: https://issues.apache.org/jira/browse/PIVOT-132
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 1.1, 1.2
> Reporter: Sandro Martini
> Assignee: Greg Brown
> Priority: Minor
> Fix For: 1.5
>
>
> As from the latest FindBugs, this warning (with High Priority) in hilited:
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> And from their doc related to this:
> This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit.
> See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information.
> Consider using java.net.URI instead.
> Trying to change URL with URI is ok here, but given compilation error in approx. 24 classes related to this.
> Needs further study.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (PIVOT-132) pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-132?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Greg Brown resolved PIVOT-132.
------------------------------
Resolution: Fixed
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: PIVOT-132
> URL: https://issues.apache.org/jira/browse/PIVOT-132
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 1.1, 1.2
> Reporter: Sandro Martini
> Assignee: Greg Brown
> Priority: Minor
> Fix For: 1.5
>
>
> As from the latest FindBugs, this warning (with High Priority) in hilited:
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> And from their doc related to this:
> This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit.
> See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information.
> Consider using java.net.URI instead.
> Trying to change URL with URI is ok here, but given compilation error in approx. 24 classes related to this.
> Needs further study.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (PIVOT-132) pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-132?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Greg Brown updated PIVOT-132:
-----------------------------
Affects Version/s: (was: 1.2)
(was: 1.1)
1.3
Fix Version/s: (was: 1.5)
1.4
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: PIVOT-132
> URL: https://issues.apache.org/jira/browse/PIVOT-132
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 1.3
> Reporter: Sandro Martini
> Assignee: Greg Brown
> Priority: Minor
> Fix For: 1.4
>
>
> As from the latest FindBugs, this warning (with High Priority) in hilited:
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> And from their doc related to this:
> This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit.
> See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information.
> Consider using java.net.URI instead.
> Trying to change URL with URI is ok here, but given compilation error in approx. 24 classes related to this.
> Needs further study.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (PIVOT-132)
pivot/wtk/ApplicationContext.java:1201
pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs,
which can be a performance hog
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738315#action_12738315 ]
Greg Brown commented on PIVOT-132:
----------------------------------
This isn't currently a high-priority item. It is worth looking into, but it will require some additional investigation that we just don't have time for right now.
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: PIVOT-132
> URL: https://issues.apache.org/jira/browse/PIVOT-132
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 1.1, 1.2
> Reporter: Sandro Martini
> Assignee: Greg Brown
> Priority: Minor
> Fix For: 1.4
>
>
> As from the latest FindBugs, this warning (with High Priority) in hilited:
> pivot/wtk/ApplicationContext.java:1201 pivot.wtk.ApplicationContext.resourceCache is or uses a map or set of URLs, which can be a performance hog
> And from their doc related to this:
> This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit.
> See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information.
> Consider using java.net.URI instead.
> Trying to change URL with URI is ok here, but given compilation error in approx. 24 classes related to this.
> Needs further study.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.