Skip to main content

warmup

Function warmup 

Source
pub fn warmup()
Expand description

Force-init the embedded WubiDict and exercise common lookup paths so the OS faults the FST’s .rodata pages into RAM and any internal fst::Map streamer state is primed. Idempotent — relies on OnceLock::get_or_init for the dict, and WubiDict::lookup for the page-touch effect. Called from Session::warmup so a host can off-load the cold-path cost to a background thread at startup instead of paying it on the user’s first keystroke. ~100-300ms on iPhone cold; <1ms idempotent.