Most of the time spent in nsPermissionManager::InitDB before first paint is deleting expired permissions
Categories
(Core :: Permission Manager, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox75 | --- | fixed |
People
(Reporter: florian, Assigned: mconley)
References
(Blocks 1 open bug)
Details
(Keywords: main-thread-io, Whiteboard: [fxperf:p2])
Attachments
(1 file)
Executing DELETE FROM moz_perms WHERE expireType = ?1 AND expireTime <= ?2
triggers 2 fsync syscalls on the main thread that are very slow compared to the other main thread I/O done by nsPermissionManager during early startup.
See this startup profile: https://perfht.ml/3bwQcr9
This is caused by the code at https://searchfox.org/mozilla-central/rev/a1592902acabf9bded973067133baaac1457f3d3/extensions/permissions/nsPermissionManager.cpp#2750-2770 that deletes expired permission entries before reading them all. I think we could instead ignore the expired entries while reading them, and later remove the expired entries from the database on disk during idle time, and preferably asynchronously.
Reporter | ||
Comment 2•4 years ago
|
||
I just saw another startup profile where these fsync calls don't exist, so it may be that we only need to write on the disk if there were actually some permission entries that expired.
Comment 3•4 years ago
|
||
(In reply to Florian Quèze [:florian] from comment #0)
I think we could instead ignore the expired entries while reading them, and later remove the expired entries from the database on disk during idle time, and preferably asynchronously.
That should be quite feasible, I think.
(In reply to Florian Quèze [:florian] from comment #2)
I just saw another startup profile where these fsync calls don't exist, so it may be that we only need to write on the disk if there were actually some permission entries that expired.
That's certainly plausible...
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
Pushed by mconley@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7ce25abc1155 Clear expired permissions from the database during idle off of the main thread. r=Ehsan
Comment 6•4 years ago
|
||
bugherder |
Description
•