Skip to content

Commit 4c6cdde

Browse files
authored
Add cold annotations (#286)
1 parent 4ac6c42 commit 4c6cdde

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/internal/core.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ impl<DP: DependencyProvider> State<DP> {
7979
}
8080

8181
/// Add an incompatibility to the state.
82+
#[cold]
8283
pub(crate) fn add_incompatibility_from_dependencies(
8384
&mut self,
8485
package: Id<DP::P>,
@@ -105,6 +106,7 @@ impl<DP: DependencyProvider> State<DP> {
105106

106107
/// Unit propagation is the core mechanism of the solving algorithm.
107108
/// CF <https://github.com/dart-lang/pub/blob/master/doc/solver.md#unit-propagation>
109+
#[cold]
108110
pub(crate) fn unit_propagation(
109111
&mut self,
110112
package: Id<DP::P>,
@@ -187,6 +189,7 @@ impl<DP: DependencyProvider> State<DP> {
187189
/// Return the root cause or the terminal incompatibility.
188190
/// CF <https://github.com/dart-lang/pub/blob/master/doc/solver.md#unit-propagation>
189191
#[allow(clippy::type_complexity)]
192+
#[cold]
190193
fn conflict_resolution(
191194
&mut self,
192195
incompatibility: IncompDpId<DP>,

src/internal/partial_solution.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ impl<DP: DependencyProvider> PartialSolution<DP> {
267267
}
268268
}
269269

270+
#[cold]
270271
pub(crate) fn pick_highest_priority_pkg(
271272
&mut self,
272273
prioritizer: impl Fn(Id<DP::P>, &DP::VS) -> DP::Priority,

src/solver.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ use crate::{DependencyConstraints, Map, Package, PubGrubError, SelectedDependenc
7070

7171
/// Main function of the library.
7272
/// Finds a set of packages satisfying dependency bounds for a given package + version pair.
73+
#[cold]
7374
pub fn resolve<DP: DependencyProvider>(
7475
dependency_provider: &DP,
7576
package: DP::P,

0 commit comments

Comments
 (0)