use std::fs; #[path = "../../harness.rs"] mod harness; use harness::*; mod pubmed_len; use pubmed_len::*; mod count_highway_crossings; use count_highway_crossings::*; macro_rules! bench { ($f:expr, $buffer:expr, $out:expr) => { bench(String::from(stringify!($f)), $f, $buffer.as_slice(), &mut $out) }; } fn main() { let mut out = String::from( "\n\ \n", ); if true { let buffer = fs::read("../../dat/yellowstone.osm").expect("Failed to read file"); bench!(count_highway_crossings, buffer, out); bench!(count_highway_crossings_cheat_and_early_out, buffer, out); } if true { let buffer = fs::read("../../dat/PMC176545.xml").expect("Failed to read file"); bench!(pubmed_len, buffer, out); bench!(pubmed_len_with_entities, buffer, out); } out.push_str("\n\n"); std::fs::write("benchmark-results.xml", out).unwrap(); }