[ https://issues.apache.org/jira/browse/MRESOLVER-320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17688564#comment-17688564 ]
ASF GitHub Bot commented on MRESOLVER-320: ------------------------------------------ cstamas commented on code in PR #241: URL: https://github.com/apache/maven-resolver/pull/241#discussion_r1106003908 ########## maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DataPool.java: ########## @@ -415,4 +440,46 @@ public int hashCode() return hashCode; } } + + private interface InternPool<K, V> + { + V get( K key ); + + V intern( K key, V value ); + } + + private static class HardInternPool<K, V> implements InternPool<K, V> + { + private final ConcurrentHashMap<K, V> map = new ConcurrentHashMap<>( 256 ); + + @Override + public V get( K key ) + { + return map.get( key ); + } + + @Override + public V intern( K key, V value ) + { + return map.computeIfAbsent( key, k -> value ); + } + } + + private static class WeakInternPool<K, V> implements InternPool<K, V> + { + private final WeakHashMap<K, WeakReference<V>> map = new WeakHashMap<>( 256 ); + + @Override + public V get( K key ) Review Comment: fixed (wrapping it instead) > Investigate slower resolving speeds as reported by users > -------------------------------------------------------- > > Key: MRESOLVER-320 > URL: https://issues.apache.org/jira/browse/MRESOLVER-320 > Project: Maven Resolver > Issue Type: Task > Affects Versions: 1.9.4 > Reporter: Tamas Cservenak > Assignee: Tamas Cservenak > Priority: Major > Fix For: 1.9.5 > > > Users on ML reported "slowness" that MAY be caused by a change added in 1.9.0 > version of resolver MRESOLVER-250. > [https://lists.apache.org/thread/r9p236z8kvqqk7ykvkgmc5wgps6n1hkf] > [https://github.com/apache/maven-resolver/pull/166#issuecomment-1413808333] > -- This message was sent by Atlassian Jira (v8.20.10#820010)