-
Notifications
You must be signed in to change notification settings - Fork 26
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
support allocator in conjugate graph #344
Conversation
ab168d3
to
bb8ac72
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## main #344 +/- ##
==========================================
- Coverage 90.26% 87.73% -2.53%
==========================================
Files 118 134 +16
Lines 7372 8613 +1241
==========================================
+ Hits 6654 7557 +903
- Misses 718 1056 +338
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
src/impl/conjugate_graph.cpp
Outdated
conjugate_graph_.emplace(from_tag_id, std::make_shared<UnorderedSet<int64_t>>(allocator_)); | ||
} | ||
|
||
auto neighbor_set = conjugate_graph_[from_tag_id]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here can reduce search cost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -169,7 +179,8 @@ ConjugateGraph::Deserialize(const Binary& binary) { | |||
|
|||
int64_t cursor = 0; | |||
ReadFuncStreamReader reader(func, cursor); | |||
return this->Deserialize(reader); | |||
BufferStreamReader buffer_reader(&reader, binary.size, allocator_); | |||
return this->Deserialize(buffer_reader); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add buffer read optimize ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
27484c2
to
1cc0b11
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/impl/conjugate_graph_test.cpp
Outdated
@@ -44,8 +46,9 @@ TEST_CASE("build, add and memory usage", "[ut][conjugate_graph]") { | |||
} | |||
|
|||
TEST_CASE("serialize and deserialize with binary", "[ut][conjugate_graph]") { | |||
vsag::DefaultAllocator allocator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use safe allocator's method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: zhongxiaoyao.zxy <[email protected]>
1cc0b11
to
6f49bac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
support allocator in conjugate graph