Skip to content

Commit

Permalink
add comments to justify avoiding termdag.to_string
Browse files Browse the repository at this point in the history
  • Loading branch information
saulshanabrook committed Dec 16, 2024
1 parent 0de97e6 commit 03c3255
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ impl EGraph {
let variants = values[1].bits as i64;
if variants == 0 {
let (cost, term) = self.extract(values[0], &mut termdag, sort);
// dont turn termdag into a string if we have messages disabled for performance reasons
if self.messages_enabled() {
let extracted = termdag.to_string(&term);
log::info!("extracted with cost {cost}: {extracted}");
Expand All @@ -355,6 +356,7 @@ impl EGraph {
}
let terms =
self.extract_variants(sort, values[0], variants as usize, &mut termdag);
// Same as above, avoid turning termdag into a string if we have messages disabled for performance
if self.messages_enabled() {
log::info!("extracted variants:");
let mut msg = String::default();
Expand Down

0 comments on commit 03c3255

Please sign in to comment.