View Issue Details

IDProjectCategoryView StatusLast Update
0003504SymmetricDSImprovementpublic2018-06-05 20:55
Reporterwoehrl01 Assigned Tommichalek  
Prioritynormal 
Status closedResolutionfixed 
Product Version3.9.8 
Target Version3.9.8Fixed in Version3.9.8 
Summary0003504: SyncTrigger slow due to synchronized this.getClass() on AbstractDatabasePlatform.getTableFromCache
DescriptionI profiled the SyncTrigger step and found out that the most time on a new startup is due to a long wait time in the method AbstractDatabasePlatform.getTableFromCache.

Also most of the time is spent in fetching the data from the database and all the fetching should be executed on working threads. (see inactivateTriggers() -> futures -> awaitTermination.

But because of synchronized this.getClass() in AbstractDatabasePlatform.getTableFromCache all these calls are serialized. As I don't see a benefit in domain logic of having this synchronized, I'd suggest removing the synchronized in resetCachedTableModel() + getTableFromCache() and replacing the HashMap with a ConcurrentHashMap<>()

I can provide a PR if desired, but I'm not sure if I overlocked something.
TagsNo tags attached.

Activities

mkurz

2018-04-03 04:25

reporter   ~0001160

ConcurrentHashMap caused Nullpointer.
tableCache = Collections.synchronizedMap(new HashMap<String, Table>());
worked.

woehrl01

2018-05-08 11:22

reporter   ~0001181

see https://github.com/JumpMind/symmetric-ds/pull/88

Issue History

Date Modified Username Field Change
2018-03-26 07:54 woehrl01 New Issue
2018-04-03 04:25 mkurz Note Added: 0001160
2018-05-08 11:22 woehrl01 Note Added: 0001181
2018-05-09 15:53 mmichalek Assigned To => mmichalek
2018-05-09 15:53 mmichalek Status new => resolved
2018-05-09 15:53 mmichalek Resolution open => fixed
2018-05-09 15:53 mmichalek Product Version => 3.9.8
2018-05-09 15:53 mmichalek Fixed in Version => 3.9.8
2018-05-09 15:53 mmichalek Target Version => 3.9.8
2018-06-05 20:55 mmichalek Status resolved => closed