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

Improve the performance of generating candidate clauses #41

Merged
merged 2 commits into from
Dec 28, 2024

Conversation

GiggleLiu
Copy link
Collaborator

@GiggleLiu GiggleLiu commented Dec 28, 2024

Before

julia> @btime OptimalBranchingMIS.OptimalBranchingCore.candidate_clauses(tbl);
  218.870 ms (5424242 allocations: 151.00 MiB)

After

julia> @btime OptimalBranchingMIS.OptimalBranchingCore.candidate_clauses(tbl) |> length
  42.664 ms (46 allocations: 1.76 MiB)

@@ -170,27 +170,28 @@ Generates candidate clauses from a branching table.
"""
function candidate_clauses(tbl::BranchingTable{INT}) where {INT}
n, bss = tbl.bit_length, tbl.table
bs = vcat(bss...)
all_clauses = Set{Clause{INT}}()
bs = reduce(vcat, bss)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The original version causes type instability.

Copy link

codecov bot commented Dec 28, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.29%. Comparing base (3ccb1b8) to head (eb62f5c).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
lib/OptimalBranchingCore/src/branch.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #41      +/-   ##
==========================================
- Coverage   90.56%   90.29%   -0.27%     
==========================================
  Files          18       18              
  Lines         816      814       -2     
==========================================
- Hits          739      735       -4     
- Misses         77       79       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ArrogantGao
Copy link
Collaborator

cool!

@ArrogantGao ArrogantGao merged commit 76d7f67 into main Dec 28, 2024
6 of 7 checks passed
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.

2 participants