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

optimize EdgeId.asString() #946

Merged
merged 1 commit into from
Apr 13, 2020
Merged

optimize EdgeId.asString() #946

merged 1 commit into from
Apr 13, 2020

Conversation

javeme
Copy link
Contributor

@javeme javeme commented Apr 12, 2020

EdgeId.asString() cost 16% time when call:

  1. GraphTx.joinTxEdges() -> Edge.switchOwner() -> Edge.assignId() ->
    EdgeId.length() -> EdgeId.asString()
  2. Serializer.parseEdge() -> Vertex.addOut|InEdge() -> EdgeId.hashCode() ->
    EdgeId.asString()

also optimize PropertyKey.newValue() cost 1.3% time:

  1. Serializer.parseProperty() -> PropertyKey.newValue() -> Class.newInstance()

about 10% performance improvement.

Change-Id: I07159d6503cc67a63d40a8fab5d7c02a42268986

EdgeId.asString() cost 16% time when call:
1. GraphTx.joinTxEdges() -> Edge.switchOwner() -> Edge.assignId() ->
   EdgeId.length() -> EdgeId.asString()
2. Serializer.parseEdge() -> Vertex.addOut|InEdge() -> EdgeId.hashCode() ->
   EdgeId.asString()

also optimize PropertyKey.newValue() cost 1.3% time:
1. Serializer.parseProperty() -> PropertyKey.newValue() -> Class.newInstance()

Change-Id: I07159d6503cc67a63d40a8fab5d7c02a42268986
@codecov
Copy link

codecov bot commented Apr 12, 2020

Codecov Report

Merging #946 into master will increase coverage by 0.02%.
The diff coverage is 84.21%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #946      +/-   ##
============================================
+ Coverage     71.95%   71.97%   +0.02%     
- Complexity     4679     4686       +7     
============================================
  Files           298      298              
  Lines         22339    22366      +27     
  Branches       3165     3175      +10     
============================================
+ Hits          16073    16098      +25     
+ Misses         4700     4696       -4     
- Partials       1566     1572       +6     
Impacted Files Coverage Δ Complexity Δ
...in/java/com/baidu/hugegraph/backend/id/EdgeId.java 80.18% <73.68%> (-0.72%) 40.00 <2.00> (+5.00) ⬇️
...n/java/com/baidu/hugegraph/schema/PropertyKey.java 81.73% <88.88%> (-1.27%) 46.00 <2.00> (+1.00) ⬇️
...va/com/baidu/hugegraph/backend/id/IdGenerator.java 82.20% <100.00%> (ø) 19.00 <0.00> (ø)
...in/java/com/baidu/hugegraph/backend/id/IdUtil.java 84.90% <100.00%> (+1.92%) 22.00 <7.00> (+1.00)
...n/java/com/baidu/hugegraph/structure/HugeEdge.java 74.13% <100.00%> (ø) 75.00 <0.00> (ø)
...a/com/baidu/hugegraph/backend/query/Condition.java 79.67% <0.00%> (ø) 31.00% <0.00%> (ø%)
...om/baidu/hugegraph/api/filter/ExceptionFilter.java 66.66% <0.00%> (+4.30%) 0.00% <0.00%> (ø%)

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 0eb7bee...7898e8a. Read the comment docs.

@Linary Linary merged commit 8a8e275 into master Apr 13, 2020
@Linary Linary deleted the tostring-optimize branch April 13, 2020 02:37
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