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

add concurrent IntSet/IntMap #1552

Merged
merged 13 commits into from
Dec 24, 2021
Merged

add concurrent IntSet/IntMap #1552

merged 13 commits into from
Dec 24, 2021

Conversation

javeme
Copy link
Contributor

@javeme javeme commented Aug 1, 2021

implement: #1636

@codecov
Copy link

codecov bot commented Aug 1, 2021

Codecov Report

Merging #1552 (4d2d44f) into master (47aa1c9) will increase coverage by 0.34%.
The diff coverage is 68.59%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1552      +/-   ##
============================================
+ Coverage     66.76%   67.11%   +0.34%     
- Complexity     7068     7094      +26     
============================================
  Files           420      422       +2     
  Lines         34731    35344     +613     
  Branches       4822     4938     +116     
============================================
+ Hits          23189    23720     +531     
- Misses         9205     9235      +30     
- Partials       2337     2389      +52     
Impacted Files Coverage Δ
.../algorithm/records/DoubleWayMultiPathsRecords.java 94.18% <ø> (ø)
.../traversal/algorithm/records/KneighborRecords.java 89.47% <ø> (ø)
...graph/traversal/algorithm/records/KoutRecords.java 85.71% <ø> (ø)
...versal/algorithm/records/record/Int2SetRecord.java 0.00% <0.00%> (ø)
...versal/algorithm/records/record/RecordFactory.java 38.46% <0.00%> (ø)
...traversal/algorithm/records/record/SyncRecord.java 0.00% <0.00%> (ø)
...versal/algorithm/records/record/Int2IntRecord.java 60.00% <28.57%> (-21.82%) ⬇️
...m/baidu/hugegraph/util/collection/Int2IntsMap.java 75.71% <50.00%> (-0.35%) ⬇️
.../algorithm/records/SingleWayMultiPathsRecords.java 55.55% <60.00%> (+1.58%) ⬆️
...graph/util/collection/ObjectIntMappingFactory.java 60.52% <60.52%> (ø)
... and 22 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 47aa1c9...4d2d44f. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Sep 8, 2021

Due to the lack of activity, the current pr is marked as stale and will be closed after 180 days, any update will remove the stale label

@imbajin imbajin added improvement General improvement and removed inactive labels Sep 10, 2021
@javeme
Copy link
Contributor Author

javeme commented Oct 26, 2021

cassandra:

Error:  Tests run: 84, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 67.99 s <<< FAILURE! - in com.baidu.hugegraph.api.ApiTestSuite
Error:  testPost(com.baidu.hugegraph.api.traversers.MultiNodeShortestPathApiTest)  Time elapsed: 13.8 s  <<< FAILURE!
java.lang.AssertionError: Response with status 500 and content {"exception":"class java.lang.OutOfMemoryError","message":"Java heap space","cause":""} expected:<200> but was:<500>
	at com.baidu.hugegraph.api.traversers.MultiNodeShortestPathApiTest.testPost(MultiNodeShortestPathApiTest.java:65)

Comment on lines 139 to 141
long bit = ukey & 0x3f;
long bitmask = 1L << bit;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to inline method

// return (int) this.size.sum();
}

private long offset(long key) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mark final

* - faster 20x than ec IntIntHashSet-segment-lock for 4 threads;
* - faster 60x than ec IntIntHashSet-global-lock for 4 threads;
*/
public static class IntSetByFixedAddr implements IntSet {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support segments of IntSetByFixedAddr?

import io.netty.util.internal.shaded.org.jctools.util.UnsafeAccess;
import sun.misc.Unsafe;

public interface IntMap {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implement concurrent-int-hashmap

Change-Id: Ib11aebc16569be6ccc8169908d4bf1e4288800f3
Change-Id: I4df9d194b3ccf57a2dd1c19dd3eb32f1bb0944a5
Change-Id: I964a2f681dc567b32f4d64e5a23f01b5a4c547c8
Change-Id: Ibf1b3f1acea5a0462303abd4325d0ec493898df8
Change-Id: Ia9412711d385db26390288b92ae96c59786ab119
Change-Id: I019566b4a1060731b0395c9b6356f3e7682c085c
Change-Id: I426b97d608015c18ddc4f789045426176e415f39
Change-Id: Iae7ac65f6bdfa1d871ebb2d5c381141fcf2ad613
Change-Id: I83d44a97b7492f9232f36877f70141cda95d26d4
Change-Id: Id41cf7b59832f619394f09ce8980098d81ef7914
Change-Id: I012e13849facdc56c49df43b8928cdcc94d3d90b
Change-Id: If5592b294ea25c46339aae436ad6c396ee6bf5e4
Change-Id: Id161294f1d6455653c70eaa5eb2bc64d9832a1a3
Copy link
Member

@imbajin imbajin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Learn it later

@imbajin imbajin merged commit 2dd2d7c into master Dec 24, 2021
@imbajin imbajin deleted the concurrent-map branch December 24, 2021 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement General improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants