[jira] [Commented] (ARTEMIS-4810) Maps of URLs can reduce the performance in ReloadManagerImpl.java

2024-06-19 Thread Justin Bertram (Jira)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-4810?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17856324#comment-17856324
 ] 

Justin Bertram commented on ARTEMIS-4810:
-

I don't believe any of these reasons apply to this code.

> Maps of URLs can reduce the performance in ReloadManagerImpl.java
> -
>
> Key: ARTEMIS-4810
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4810
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Galkin Alexey
>Priority: Minor
>
> [In line 
> 41|https://github.com/apache/activemq-artemis/blob/main/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/reload/ReloadManagerImpl.java#L41],
>  when creating an associative array registry, you can use java.net.URI 
> instead of java.net.URL to avoid the performance penalty
> {code:java}
> private final Map registry = new HashMap<>();{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: issues-unsubscr...@activemq.apache.org
For additional commands, e-mail: issues-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact




[jira] [Commented] (ARTEMIS-4810) Maps of URLs can reduce the performance in ReloadManagerImpl.java

2024-06-09 Thread Galkin Alexey (Jira)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-4810?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17853494#comment-17853494
 ] 

Galkin Alexey commented on ARTEMIS-4810:


Using {{java.net.URL}} may result in lower performance than {{java.net.URI}} 
for the following reasons:

1)Network Operations: The equals and hashCode methods in the URL class can 
cause network operations such as DNS resolution, resulting in significant 
latency.
2)Mutability: URL objects can change, which requires additional checks and can 
increase the execution time of comparison and hashing operations.
3)Unpredictability: Network operations can have unpredictable execution times, 
which is especially critical for use in associative arrays where fast and 
predictable operation of the equals and hashCode methods is important.


For these reasons, {{java.net.URI}} is the preferred choice for storing 
references in associative arrays, providing better performance and 
predictability.

> Maps of URLs can reduce the performance in ReloadManagerImpl.java
> -
>
> Key: ARTEMIS-4810
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4810
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Galkin Alexey
>Priority: Minor
>
> [In line 
> 41|https://github.com/apache/activemq-artemis/blob/main/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/reload/ReloadManagerImpl.java#L41],
>  when creating an associative array registry, you can use java.net.URI 
> instead of java.net.URL to avoid the performance penalty
> {code:java}
> private final Map registry = new HashMap<>();{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: issues-unsubscr...@activemq.apache.org
For additional commands, e-mail: issues-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact




[jira] [Commented] (ARTEMIS-4810) Maps of URLs can reduce the performance in ReloadManagerImpl.java

2024-06-08 Thread Justin Bertram (Jira)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-4810?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17853385#comment-17853385
 ] 

Justin Bertram commented on ARTEMIS-4810:
-

What performance penalty does {{java.net.URL}} have vs. {{java.net.URI}}?

> Maps of URLs can reduce the performance in ReloadManagerImpl.java
> -
>
> Key: ARTEMIS-4810
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4810
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Reporter: Galkin Alexey
>Priority: Minor
>
> [In line 
> 41|https://github.com/apache/activemq-artemis/blob/main/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/reload/ReloadManagerImpl.java#L41],
>  when creating an associative array registry, you can use java.net.URI 
> instead of java.net.URL to avoid the performance penalty
> {code:java}
> private final Map registry = new HashMap<>();{code}
>  
> Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.
> Author Alexey Galkin.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: issues-unsubscr...@activemq.apache.org
For additional commands, e-mail: issues-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact