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

support allocator in conjugate graph #344

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

ShawnShawnYou
Copy link
Collaborator

support allocator in conjugate graph

@ShawnShawnYou ShawnShawnYou added kind/improvement Code improvements (variable/function renaming, refactoring, etc. ) version/0.13 labels Jan 19, 2025
@ShawnShawnYou ShawnShawnYou self-assigned this Jan 19, 2025
@ShawnShawnYou ShawnShawnYou force-pushed the support-allocator-in-conjugate-graph branch 2 times, most recently from ab168d3 to bb8ac72 Compare January 20, 2025 07:12
Copy link
Collaborator

@wxyucs wxyucs left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All 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     
Flag Coverage Δ
cpp 87.73% <100.00%> (-2.53%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
common 89.38% <ø> (+2.73%) ⬆️
datacell 90.18% <ø> (ø)
index 90.98% <100.00%> (+0.29%) ⬆️
simd 69.28% <ø> (-30.72%) ⬇️

Continue to review full report in Codecov by Sentry.

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

conjugate_graph_.emplace(from_tag_id, std::make_shared<UnorderedSet<int64_t>>(allocator_));
}

auto neighbor_set = conjugate_graph_[from_tag_id];
Copy link
Collaborator

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

Copy link
Collaborator Author

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);
Copy link
Collaborator

Choose a reason for hiding this comment

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

add buffer read optimize ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@ShawnShawnYou ShawnShawnYou force-pushed the support-allocator-in-conjugate-graph branch 2 times, most recently from 27484c2 to 1cc0b11 Compare January 21, 2025 04:01
Copy link
Collaborator

@inabao inabao left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -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;
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@ShawnShawnYou ShawnShawnYou force-pushed the support-allocator-in-conjugate-graph branch from 1cc0b11 to 6f49bac Compare January 21, 2025 09:36
Copy link
Collaborator

@LHT129 LHT129 left a comment

Choose a reason for hiding this comment

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

LGTM

@inabao inabao merged commit cf44602 into main Jan 22, 2025
14 of 16 checks passed
@inabao inabao deleted the support-allocator-in-conjugate-graph branch January 22, 2025 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/improvement Code improvements (variable/function renaming, refactoring, etc. ) size/M version/0.13
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants