Bug 1546838 - Remove migrations and all final remaining LMDB disk hits during startup, r=nanj,perftest-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D99324
This commit is contained in:
Victor Porof 2021-09-13 07:10:31 +00:00
parent 331bf799c4
commit cdc159cdd9
4 changed files with 2 additions and 23 deletions

View File

@ -214,13 +214,6 @@ const startupPhases = {
read: 1,
close: 1,
},
{
// bug 1546838
path: "ProfD:xulstore/data.mdb",
condition: WIN,
read: 1,
write: 1,
},
],
"before opening first browser window": [
@ -350,12 +343,6 @@ const startupPhases = {
condition: WIN && !AppConstants.MOZILLA_OFFICIAL,
stat: 1,
},
{
// bug 1546838
path: "ProfD:xulstore/data.mdb",
condition: MAC,
write: 1,
},
],
// We are at this phase once we are ready to handle user events.

View File

@ -602,12 +602,6 @@
"minbytes": 0,
"maxbytes": 702
},
"{profile}\\xulstore\\data.mdb": {
"mincount": 0,
"maxcount": 4,
"minbytes": 0,
"maxbytes": 608
},
"{profile}\\xulstore\\data.safe.bin": {
"mincount": 0,
"maxcount": 4,

View File

@ -11,7 +11,7 @@ use nserror::{nsresult, NS_ERROR_FAILURE};
use nsstring::nsCString;
use owned_value::owned_to_variant;
use rkv::backend::{BackendInfo, SafeMode, SafeModeDatabase, SafeModeEnvironment};
use rkv::{Migrator, OwnedValue, StoreError, StoreOptions, Value};
use rkv::{OwnedValue, StoreError, StoreOptions, Value};
use std::{
path::Path,
str,
@ -199,7 +199,6 @@ impl Task for GetOrCreateTask {
// https://bugzilla.mozilla.org/show_bug.cgi?id=1531887
let path = Path::new(str::from_utf8(&self.path)?);
let rkv = manager.get_or_create(path, Rkv::new::<SafeMode>)?;
Migrator::easy_migrate_lmdb_to_safe_mode(path, rkv.read()?)?;
{
let env = rkv.read()?;
let load_ratio = env.load_ratio()?.unwrap_or(0.0);

View File

@ -11,7 +11,7 @@ use moz_task::is_main_thread;
use nsstring::nsString;
use once_cell::sync::Lazy;
use rkv::backend::{SafeMode, SafeModeDatabase, SafeModeEnvironment};
use rkv::{Migrator, StoreOptions, Value};
use rkv::{StoreOptions, Value};
use std::{
collections::BTreeMap,
fs::{create_dir_all, remove_file, File},
@ -50,7 +50,6 @@ pub(crate) fn get_database() -> XULStoreResult<Database> {
let xulstore_dir = get_xulstore_dir()?;
let xulstore_path = xulstore_dir.as_path();
let rkv = manager.get_or_create(xulstore_path, Rkv::new::<SafeMode>)?;
Migrator::easy_migrate_lmdb_to_safe_mode(xulstore_path, rkv.read()?)?;
let store = rkv.read()?.open_single("db", StoreOptions::create())?;
Ok(Database::new(rkv, store))
}