View Issue Details

IDProjectCategoryView StatusLast Update
0003504SymmetricDSImprovementpublic2018-05-09 11:53
Reporterwoehrl01Assigned Tommichalek 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
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 00:25

reporter   ~0001160

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

woehrl01

2018-05-08 07:22

reporter   ~0001181

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

Issue History

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