In the embedded world the specifics often outweigh the general. Specifics like - what storage are you using? What clock does it run at? What page size are you using (you'd want to pass this to sqlite for best results)? What locks are you using? Is there a 1mS undocumented sleep on startup to allow some peripheral to stabilise that accidentally got pulled in to the main code path (has happened to me - the initialize function didn't set the initialized flag)?
I'd expect closer to 5uS than 5mS, but I'm not that familiar with the ESP32 devices