use retex_kpath::{FileFormat, Kpathsea, Options};
fn main() {
let t = std::time::Instant::now();
let mut o = Options::lualatex();
o.cache_dir = Some(std::env::temp_dir().join("retex-kpse-test"));
let mut k = Kpathsea::new(o).unwrap();
let init = t.elapsed();
let t = std::time::Instant::now();
for n in [
"latex.ltx",
"article.cls",
"size10.clo",
"lmroman10-regular.otf",
"ltluatex.lua",
] {
let f = if n.ends_with(".otf") {
FileFormat::OpenType
} else if n.ends_with(".lua") {
FileFormat::Lua
} else {
FileFormat::Tex
};
let _ = k.find_file(n, f);
}
println!("init {init:?}, 5 lookups {:?}", t.elapsed());
}