Commit Graph

2 Commits

Author SHA1 Message Date
Sylvestre Ledru
265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Jan Varga
5809f14bbd Bug 1286798 - Part 36: Allow snapshot initialization to a specific load state; r=asuth
Before this patch, it was only possible to initialize a snapshot to the Partial state or AllOrderedItems state. Now there's a third state AllOrderedKeys.
This improves performance by eliminating sync calls to parent process when we know nothing about a key in content process (in that case we have to use a sync call to the parent process to see if there's a value for it).
With this patch we always try to send all keys to content when a snapshot is being initialized. For this to work efficiently, we cache the size of all keys.
Having cached size of all keys also allows us to just iterate the mValues hashtable when the size of keys is bigger than snapshot prefill threshold (instead of iterating over the mKeys array and joining with mValues for each particular key).
There's some additional cleanup in snapshot info construction and Datastore::SetItem/RemoveItem/Clear methods.
2018-11-29 21:49:10 +01:00