Closed
Bug 1110063
Opened 10 years ago
Closed 10 years ago
Make mozSettings use readonly indexedDB transaction when possible
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: gerard-majax, Assigned: gerard-majax)
References
Details
Attachments
(1 file, 4 obsolete files)
(deleted),
patch
|
gerard-majax
:
review+
|
Details | Diff | Splinter Review |
When a lock only queues get requests, there is no need to open a readwrite transaction. This could help speedup things.
Assignee | ||
Comment 1•10 years ago
|
||
Whenever a settings lock does only read operations (i.e. lock.get()),
there is no need that the underlying indexedDB transaction should be
opened as readwrite. Doing so, we will be able to parallelize some
request and avoid locking that should in the end allow for faster
operations.
Comment 2•10 years ago
|
||
Comment on attachment 8534897 [details] [diff] [review]
Open readonly transaction for settings lock when possible r=qdot
Review of attachment 8534897 [details] [diff] [review]:
-----------------------------------------------------------------
r+ with expansion of comment.
::: dom/settings/SettingsRequestManager.jsm
@@ +119,5 @@
> // Lets us know if this lock has been used to clear at any point.
> hasCleared: false,
> + // Whether we want to do a read only transaction. Define be default, and let
> + // queueTask() set this to false if we queue any "set" task.
> + forceReadOnly: true,
We should expand this to explain the assumption we're making. Something like:
forceReadOnly sets whether we want to do a read only transaction. Define true by default, and let queueTask() set this to false if we queue any "set" task. Since users of settings locks will queue all tasks before any idb transaction is created, we know we will have all needed information to set this before creating a transaction.
Attachment #8534897 -
Flags: review+
Assignee | ||
Comment 3•10 years ago
|
||
Whenever a settings lock does only read operations (i.e. lock.get()),
there is no need that the underlying indexedDB transaction should be
opened as readwrite. Doing so, we will be able to parallelize some
request and avoid locking that should in the end allow for faster
operations.
Assignee | ||
Updated•10 years ago
|
Attachment #8534897 -
Attachment is obsolete: true
Assignee | ||
Comment 4•10 years ago
|
||
Rebased on top of master, and updated the comment.
Assignee | ||
Comment 5•10 years ago
|
||
Assignee | ||
Comment 6•10 years ago
|
||
Whenever a settings lock does only read operations (i.e. lock.get()),
there is no need that the underlying indexedDB transaction should be
opened as readwrite. Doing so, we will be able to parallelize some
request and avoid locking that should in the end allow for faster
operations. Enabling this feature is controlled by the preference
dom.mozSettings.allowForceReadOnly, defaulting to false for now.
Assignee | ||
Updated•10 years ago
|
Attachment #8536010 -
Attachment is obsolete: true
Assignee | ||
Comment 7•10 years ago
|
||
Comment on attachment 8537740 [details] [diff] [review]
Open readonly transaction for settings lock when possible r=qdot
Hiding this behind a pref, so that we can land and ask a set of people to dogfood and/or easily toggle off.
I've been using it on some devices for several days, but given how critical settings is, I'd prefer that we bake it properly.
Attachment #8537740 -
Flags: review?(kyle)
Assignee | ||
Comment 8•10 years ago
|
||
Try with pref off: https://tbpl.mozilla.org/?tree=Try&rev=34aed7bd49a5
Assignee | ||
Comment 9•10 years ago
|
||
Try with pref on: https://tbpl.mozilla.org/?tree=Try&rev=4b80904713e8
Comment 10•10 years ago
|
||
Comment on attachment 8537740 [details] [diff] [review]
Open readonly transaction for settings lock when possible r=qdot
Review of attachment 8537740 [details] [diff] [review]:
-----------------------------------------------------------------
r+ with comments addressed
::: b2g/app/b2g.js
@@ +1073,5 @@
> +
> +// Controlling whether we want to allow forcing some Settings
> +// IndexedDB transactions to be opened as readonly or keep everything as
> +// readwrite.
> +pref("dom.mozSettings.allowForceReadOnly", false);
This and the debug prefs above it should also be added to modules/libpref/init/all.js.
Attachment #8537740 -
Flags: review?(kyle) → review+
Assignee | ||
Comment 11•10 years ago
|
||
Whenever a settings lock does only read operations (i.e. lock.get()),
there is no need that the underlying indexedDB transaction should be
opened as readwrite. Doing so, we will be able to parallelize some
request and avoid locking that should in the end allow for faster
operations. Enabling this feature is controlled by the preference
dom.mozSettings.allowForceReadOnly, defaulting to false for now.
Assignee | ||
Comment 12•10 years ago
|
||
Comment on attachment 8537879 [details] [diff] [review]
Open readonly transaction for settings lock when possible r=qdot
Should be addressing latest comment.
Attachment #8537879 -
Flags: review?(kyle)
Assignee | ||
Updated•10 years ago
|
Attachment #8537740 -
Attachment is obsolete: true
Comment 13•10 years ago
|
||
Comment on attachment 8537879 [details] [diff] [review]
Open readonly transaction for settings lock when possible r=qdot
Review of attachment 8537879 [details] [diff] [review]:
-----------------------------------------------------------------
r+ with comments addressed. Which means you don't have to ask for r? again. :)
::: modules/libpref/init/all.js
@@ +4420,5 @@
> +// MozSettings debugging prefs for each component
> +pref("dom.mozSettings.SettingsDB.debug.enabled", true);
> +pref("dom.mozSettings.SettingsManager.debug.enabled", true);
> +pref("dom.mozSettings.SettingsRequestManager.debug.enabled", true);
> +pref("dom.mozSettings.SettingsService.debug.enabled", true);
You want all of these off by default here, most likely.
Attachment #8537879 -
Flags: review?(kyle) → review+
Assignee | ||
Comment 14•10 years ago
|
||
Whenever a settings lock does only read operations (i.e. lock.get()),
there is no need that the underlying indexedDB transaction should be
opened as readwrite. Doing so, we will be able to parallelize some
request and avoid locking that should in the end allow for faster
operations. Enabling this feature is controlled by the preference
dom.mozSettings.allowForceReadOnly, defaulting to false for now.
Assignee | ||
Updated•10 years ago
|
Attachment #8537879 -
Attachment is obsolete: true
Assignee | ||
Comment 15•10 years ago
|
||
Comment on attachment 8537924 [details] [diff] [review]
Open readonly transaction for settings lock when possible r=qdot
Carrying r+ from :qdot, just changing values of debug prefs.
Attachment #8537924 -
Flags: review+
Comment 17•10 years ago
|
||
Keywords: checkin-needed
Comment 18•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
Assignee | ||
Updated•10 years ago
|
Blocks: mozSettings-perf
Assignee | ||
Updated•10 years ago
|
No longer blocks: mozSettings-perf
Depends on: mozSettings-perf
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•