Skip to content

Commit

Permalink
Merge pull request #22 from TrevorHansen/om5
Browse files Browse the repository at this point in the history
Use a map that is faster with integer keys
  • Loading branch information
oflatt authored Dec 13, 2023
2 parents 934bab7 + 86db1e8 commit 361d935
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pico-args = { version = "0.5.0", features = ["eq-separator"] }
anyhow = "1.0.71"
coin_cbc = { version = "0.1.6", optional = true }
im-rc = "15.1.0"
rustc-hash = "1.1.0"

rpds = "1.1.0"
[dependencies.egraph-serialize]
Expand Down
5 changes: 3 additions & 2 deletions src/extract/greedy_dag.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use super::*;
use rustc_hash::FxHashMap;

struct CostSet {
costs: std::collections::HashMap<ClassId, Cost>,
costs: FxHashMap<ClassId, Cost>,
total: Cost,
choice: NodeId,
}
Expand All @@ -25,7 +26,7 @@ impl Extractor for GreedyDagExtractor {
'node_loop: for (node_id, node) in &nodes {
let cid = egraph.nid_to_cid(node_id);
let mut cost_set = CostSet {
costs: std::collections::HashMap::new(),
costs: FxHashMap::default(),
total: Cost::default(),
choice: node_id.clone(),
};
Expand Down

0 comments on commit 361d935

Please sign in to comment.