[Unicode]   Common Locale Data Repository : Bug Tracking Home | Site Map | Search
 
Modify

CLDR Ticket #7278(accepted unknown)

Opened 3 years ago

Last modified 13 months ago

Change highly-contendend HashMaps/SynchronizedMap to ConcurrentHashMap [only branch]

Reported by: ribnitz Owned by: googler
Component: unknown Data Locale:
Phase: dsub Review:
Weeks: Data Xpath:
Xref:

Description

The use of Collections.synchronizedMap (or equivalent: HashMap, with synchronization on the map object) is common in the CLDR Tools project.

Synchronization on the Map means that only one thread at a time can access or modify the map. (java.util.concurrent.) ConcurrentHashMap was developed to solve this problem. An instance of a highly contended map is in in CLDRFile.DistingishedXPath (distinguishingMap)

Getting rid of the synchronized blocks where possible, and using a ConcurrentHashMap instead signifies a performance improvements.

Attachments

Change History

comment:1 Changed 3 years ago by mark

  • Owner changed from anybody to ribnitz
  • Priority changed from assess to major
  • Status changed from new to assigned
  • Milestone changed from UNSCH to 26dsub

comment:2 Changed 3 years ago by emmons

  • Milestone changed from 26dsub to 26dvet

Moving all 26dsub to 26dvet. Please assess the need to complete tickets by 26dvet, which is 2014-06-19

comment:3 Changed 3 years ago by ribnitz

  • Status changed from assigned to reviewing
  • Review set to mark

DistinguishedXPath is already a ConcurrentMap; rewrote XMLSource which also contained two cases.

comment:4 Changed 3 years ago by mark

  • Status changed from reviewing to accepted

Why are you using weak references, as in

private transient ConcurrentMap<String, AliasLocation> getSourceLocaleIDCache =

936 new MapMaker().weakKeys().makeMap();

As far as I can tell, these will be flushed asap, thus negating the value of the cache.

If you are using weak or soft keys or values anyplace else, please surface that to me.

comment:5 Changed 3 years ago by mark

  • Owner changed from ribnitz to googler

comment:6 Changed 3 years ago by mark

  • Milestone changed from 26dvet to 27dsub

comment:7 Changed 3 years ago by markus

  • Phase set to dsub
  • Milestone changed from 27dsub to 27

comment:8 Changed 2 years ago by emmons

  • Milestone changed from 27 to UNSCH

comment:9 Changed 13 months ago by mark

  • Review mark deleted
  • Summary changed from Change highly-contendend HashMaps/SynchronizedMap to ConcurrentHashMap to Change highly-contendend HashMaps/SynchronizedMap to ConcurrentHashMap [only branch]
View

Add a comment

Modify Ticket

Action
as accepted
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.