(refractor) timer and warm up query

This commit is contained in:
polv committed 2026-03-03 12:44:54 +07:00
1 parent 1b2ee0f691
commit d6f2b145c3
13 files changed
+294 -47

No files matched your search

+7 -8
View File
@@ -1,7 +1,5 @@
use std::time::Instant;
use anyhow::Ok;
use cjdic2_core::AppService;
use cjdic2_core::{AppService, Timer};
mod common;
use common::get_db_dir;
@@ -9,11 +7,12 @@ use common::get_db_dir;
fn main() -> Result<(), anyhow::Error> {
let service = AppService::new(get_db_dir())?;
let start = Instant::now();
let rs = service.search_yomitan("擦る", "する", 10, 0)?;
println!("{:#?}", rs);
println!("n={}", rs.len());
println!("[{:.2?}]", start.elapsed());
{
let _timer = Timer::new("Search".to_string());
let rs = service.search_yomitan("擦る", "する", 10, 0)?;
println!("{:#?}", rs);
println!("n={}", rs.len());
}
Ok(())
}