Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Issue 2403913004: Small: Serialize the store's hash_prefix_map_ to file in WriteToDisk() (Closed)

Created:
4 years, 2 months ago by vakh (use Gerrit instead)
Modified:
4 years, 2 months ago
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Serialize the store's hash_prefix_map_ to file in WriteToDisk() Associating with bug 651911 since I am writing RAW hash prefixes on disk in this CL to improve startup time. BUG=543161, 651911 Committed: https://crrev.com/9f1266e1e3cdb43dd9f5031f1dd3f5e7262a0d13 Cr-Commit-Position: refs/heads/master@{#425233}

Patch Set 1 : Serialize the store's hash_prefix_map_ to file in WriteToDisk() #

Total comments: 10

Patch Set 2 : nparker@ review #

Patch Set 3 : git rebase #

Total comments: 2

Patch Set 4 : rebase. and temporary scope to make sure that |contents| get destroyed as soon as we're done using … #

Unified diffs Side-by-side diffs Delta from patch set Stats (+67 lines, -89 lines) Patch
M components/safe_browsing_db/v4_store.h View 1 2 2 chunks +4 lines, -3 lines 0 comments Download
M components/safe_browsing_db/v4_store.cc View 1 2 3 4 chunks +37 lines, -27 lines 0 comments Download
M components/safe_browsing_db/v4_store_unittest.cc View 1 2 6 chunks +26 lines, -59 lines 0 comments Download

Messages

Total messages: 33 (19 generated)
vakh (use Gerrit instead)
Serialize the store's hash_prefix_map_ to file in WriteToDisk()
4 years, 2 months ago (2016-10-10 23:11:14 UTC) #3
vakh (use Gerrit instead)
4 years, 2 months ago (2016-10-10 23:11:52 UTC) #8
Scott Hess - ex-Googler
lgtm.
4 years, 2 months ago (2016-10-11 17:26:37 UTC) #11
Nathan Parker
https://codereview.chromium.org/2403913004/diff/20001/components/safe_browsing_db/v4_store.cc File components/safe_browsing_db/v4_store.cc (right): https://codereview.chromium.org/2403913004/diff/20001/components/safe_browsing_db/v4_store.cc#newcode646 components/safe_browsing_db/v4_store.cc:646: *(lur->mutable_checksum()) = checksum; nit: lur->set_checksum(checksum)? https://codereview.chromium.org/2403913004/diff/20001/components/safe_browsing_db/v4_store.cc#newcode659 components/safe_browsing_db/v4_store.cc:659: additions->mutable_raw_hashes()->set_raw_hashes(map_iter.second); Note: ...
4 years, 2 months ago (2016-10-11 20:29:42 UTC) #13
vakh (use Gerrit instead)
nparker@ review
4 years, 2 months ago (2016-10-11 21:50:17 UTC) #14
vakh (use Gerrit instead)
Thanks for the review. PTAL. https://codereview.chromium.org/2403913004/diff/20001/components/safe_browsing_db/v4_store.cc File components/safe_browsing_db/v4_store.cc (right): https://codereview.chromium.org/2403913004/diff/20001/components/safe_browsing_db/v4_store.cc#newcode646 components/safe_browsing_db/v4_store.cc:646: *(lur->mutable_checksum()) = checksum; On ...
4 years, 2 months ago (2016-10-11 21:50:39 UTC) #16
vakh (use Gerrit instead)
git rebase
4 years, 2 months ago (2016-10-13 06:05:56 UTC) #20
Nathan Parker
lgtm https://codereview.chromium.org/2403913004/diff/60001/components/safe_browsing_db/v4_store.cc File components/safe_browsing_db/v4_store.cc (right): https://codereview.chromium.org/2403913004/diff/60001/components/safe_browsing_db/v4_store.cc#newcode652 components/safe_browsing_db/v4_store.cc:652: contents.clear(); I think this doesn't actually free memory. ...
4 years, 2 months ago (2016-10-14 00:10:05 UTC) #21
Scott Hess - ex-Googler
https://codereview.chromium.org/2403913004/diff/60001/components/safe_browsing_db/v4_store.cc File components/safe_browsing_db/v4_store.cc (right): https://codereview.chromium.org/2403913004/diff/60001/components/safe_browsing_db/v4_store.cc#newcode652 components/safe_browsing_db/v4_store.cc:652: contents.clear(); On 2016/10/14 00:10:05, Nathan Parker wrote: > I ...
4 years, 2 months ago (2016-10-14 00:16:18 UTC) #22
vakh (use Gerrit instead)
rebase. and temporary scope to make sure that |contents| get destroyed as soon as we're ...
4 years, 2 months ago (2016-10-14 01:02:21 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2403913004/80001
4 years, 2 months ago (2016-10-14 01:16:48 UTC) #28
commit-bot: I haz the power
Committed patchset #4 (id:80001)
4 years, 2 months ago (2016-10-14 01:57:32 UTC) #30
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/9f1266e1e3cdb43dd9f5031f1dd3f5e7262a0d13 Cr-Commit-Position: refs/heads/master@{#425233}
4 years, 2 months ago (2016-10-14 01:59:40 UTC) #32
vakh (use Gerrit instead)
4 years, 2 months ago (2016-10-14 06:04:59 UTC) #33
Message was sent while issue was closed.
On 2016/10/14 00:16:18, Scott Hess wrote:
>
https://codereview.chromium.org/2403913004/diff/60001/components/safe_browsin...
> File components/safe_browsing_db/v4_store.cc (right):
> 
>
https://codereview.chromium.org/2403913004/diff/60001/components/safe_browsin...
> components/safe_browsing_db/v4_store.cc:652: contents.clear();
> On 2016/10/14 00:10:05, Nathan Parker wrote:
> > I think this doesn't actually free memory. You probably want to call
> > shrink_to_fit() after, or else declare the string as a unique_ptr so you can
> > reset it.
> 
> The canonical way to release string memory is something like
> std::string().swap(contents), though something horrible like
> ignore_result(std::move(contents)) would probably work, too.  Of course you
> could just scope it appropriately, albeit at some cost to rearrange your
> variable declarations.
> 
> Also IMHO, don't unique_ptr it.  It works, but it's not much work to avoid the
> extra heap allocation.

Done with temporary scope.

Powered by Google App Engine
This is Rietveld 408576698