Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix cache metrics perf issue #1515

Merged
merged 5 commits into from
Jun 24, 2021
Merged

fix cache metrics perf issue #1515

merged 5 commits into from
Jun 24, 2021

Conversation

javeme
Copy link
Contributor

@javeme javeme commented Jun 24, 2021

test perf on Mac (8 CPUs) with threads=10 loop=8kw:

ConcurrentHashMap RamCache RamCache metrics
1 3.8~6.5s 5.5~9.1s none
2 5.4 7.1 volatile enabledMetrics=false
3 5.4 7.8 volatile enabledMetrics=true
4 5.1 28.9 volatile hits
5 5.1 9.4 LongAdder hits

Change-Id: Ifac465520f646d07f1ffbd60a3e5f36d1b1985ce
Change-Id: Ifeb44103c8998cbbd484d27d5660c08271699458
@imbajin
Copy link
Member

imbajin commented Jun 24, 2021

and here are some fire svgs for perf case with kout: (save as .svg check the details)

  • use volatile to count
    volatile
  • use LongAdder to count
    LongAdder
  • no count (use original ConcurrentHashMap)
    ConcurrentHashMap

Change-Id: I486b8feefa76a7ac3b7ca44f23285c6e3ebe780f
@codecov
Copy link

codecov bot commented Jun 24, 2021

Codecov Report

Merging #1515 (0dfc5e9) into master (0c51de5) will decrease coverage by 0.54%.
The diff coverage is 88.57%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1515      +/-   ##
============================================
- Coverage     60.02%   59.47%   -0.55%     
- Complexity      305     6114    +5809     
============================================
  Files           426      406      -20     
  Lines         35096    33066    -2030     
  Branches       4970     4574     -396     
============================================
- Hits          21065    19666    -1399     
+ Misses        11894    11336     -558     
+ Partials       2137     2064      -73     
Impacted Files Coverage Δ
...om/baidu/hugegraph/backend/cache/CacheManager.java 87.03% <66.66%> (-1.20%) ⬇️
...va/com/baidu/hugegraph/backend/cache/RamCache.java 72.47% <83.33%> (+0.31%) ⬆️
...m/baidu/hugegraph/backend/cache/AbstractCache.java 77.00% <91.66%> (+5.84%) ⬆️
...ugegraph/backend/cache/CachedGraphTransaction.java 84.33% <100.00%> (+0.09%) ⬆️
...om/baidu/hugegraph/backend/cache/OffheapCache.java 57.83% <100.00%> (ø)
...raph/backend/store/postgresql/PostgresqlStore.java 0.00% <0.00%> (-100.00%) ⬇️
...raph/backend/store/postgresql/PostgresqlTable.java 0.00% <0.00%> (-96.83%) ⬇️
...kend/store/postgresql/PostgresqlStoreProvider.java 0.00% <0.00%> (-92.50%) ⬇️
...aph/backend/store/postgresql/PostgresqlTables.java 0.00% <0.00%> (-87.96%) ⬇️
...raph/backend/store/cassandra/CassandraMetrics.java 0.00% <0.00%> (-86.96%) ⬇️
... and 60 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c51de5...0dfc5e9. Read the comment docs.

Change-Id: I9bd9f48a7dc35ab9c42cbc141e0a54824c974b36
imbajin
imbajin previously approved these changes Jun 24, 2021
zhoney
zhoney previously approved these changes Jun 24, 2021
Change-Id: Ic613f1d387dae26cc3cd6b69346d28a912453f72
@javeme javeme merged commit ab69c8b into master Jun 24, 2021
@javeme javeme deleted the cache-metrics-perf-fix branch June 24, 2021 15:00
jadepeng pushed a commit to jadepeng/hugegraph that referenced this pull request Jun 25, 2021
* fix cache metrics perf issue
* enable cache metrics for graph cache
* add collectMetrics()
* move containsKey into access
* fix not call access() when size > halfCapacity

Change-Id: Ifac465520f646d07f1ffbd60a3e5f36d1b1985ce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants