(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

+2 -9
View File
@@ -7,11 +7,10 @@ use std::{
collections::HashMap,
io::{Cursor, Read},
path::{Path, PathBuf},
time::Instant,
};
use zip::ZipArchive;
use crate::CJDicError;
use crate::{CJDicError, Timer};
fn blake3_hex(s: &str) -> String {
format!("{}", hash(s.as_bytes()))
@@ -274,8 +273,8 @@ impl YomitanWriter {
Callback: Fn(YomitanZipImportProgress),
{
let bundle_name = zip_file.file_name();
let _timer = Timer::new(format!("Importing {}", bundle_name));
let start_time = Instant::now();
self.conn.execute_batch("PRAGMA foreign_keys = off")?;
let cursor = Cursor::new(zip_file.bytes()?);
@@ -593,12 +592,6 @@ impl YomitanWriter {
tx.commit()?;
println!(
"Importing {} takes {:.2?}",
zip_file.file_name(),
start_time.elapsed()
);
self.conn.execute_batch(
"
PRAGMA foreign_keys = on;