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

Issue 23477015: [sync] Significantly speed up password model association on mac (Closed)

Created:
7 years, 3 months ago by Raghu Simha
Modified:
7 years, 2 months ago
CC:
chromium-reviews, rlarocque, tim (not reviewing)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

[sync] Significantly speed up password model association on mac During password model association on mac, the helper function internal_keychain_helpers::GetPasswordsForForms individually searches through the OS keychain for passwords matching each web form for which a password was saved. With tracing turned on, it turned out that these O(N) keychain searches, one for each password stored in the keychain, accounted for more than 80% of the password model association time. In this patch, we make GetPasswordsForForms first pre-load the attributes of all passwords stored in the keychain without loading the actual password data (this doesn't require authorization and won't pop up a UI prompt), and then individually load password data only for the keychain entries that match the web forms we're interested in. This is still considerably faster than doing O(N) keychain searches. For a test account with 50 synced passwords, this change yielded almost an 80% reduction in the time spent in GetPasswordsForForms(). BUG=263685 TEST=Enable tracing for password model association and measure its performance with and without this change. R=stuartmorgan@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=227954

Patch Set 1 #

Total comments: 2

Patch Set 2 : First pre-load only attributes of all items, then match, then selectively load passwords. #

Patch Set 3 : Further reduce keychain reads #

Total comments: 12

Patch Set 4 : Rebase (no code changes) #

Patch Set 5 : Address feedback #

Total comments: 14

Patch Set 6 : Address feedback; Add more unit tests. #

Patch Set 7 : Rebase (no code changes) #

Total comments: 10

Patch Set 8 : Fix nits. #

Patch Set 9 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+323 lines, -89 lines) Patch
M chrome/browser/password_manager/password_store_mac.cc View 1 2 3 4 5 6 7 15 chunks +142 lines, -57 lines 0 comments Download
M chrome/browser/password_manager/password_store_mac_internal.h View 1 2 3 4 5 6 7 5 chunks +62 lines, -28 lines 0 comments Download
M chrome/browser/password_manager/password_store_mac_unittest.cc View 1 2 3 4 5 5 chunks +119 lines, -4 lines 0 comments Download

Messages

Total messages: 24 (0 generated)
Raghu Simha
Stuart, please review. Thanks.
7 years, 3 months ago (2013-08-29 03:44:42 UTC) #1
stuartmorgan
https://codereview.chromium.org/23477015/diff/1/chrome/browser/password_manager/password_store_mac.cc File chrome/browser/password_manager/password_store_mac.cc (right): https://codereview.chromium.org/23477015/diff/1/chrome/browser/password_manager/password_store_mac.cc#newcode449 chrome/browser/password_manager/password_store_mac.cc:449: // We load all passwords added to the keychain ...
7 years, 3 months ago (2013-08-29 20:24:23 UTC) #2
Raghu Simha
+Ilya. Thanks for the review, Stuart. As I mention in my response to your comment, ...
7 years, 3 months ago (2013-08-29 23:28:46 UTC) #3
stuartmorgan
I thought about this more last night, and if you want to do significant restructuring, ...
7 years, 3 months ago (2013-08-30 09:50:11 UTC) #4
Raghu Simha
Stuart, PTAL. On 2013/08/30 09:50:11, stuartmorgan wrote: > I thought about this more last night, ...
7 years, 3 months ago (2013-08-30 23:12:31 UTC) #5
Raghu Simha
Post-holiday-weekend ping.
7 years, 3 months ago (2013-09-03 17:46:26 UTC) #6
Raghu Simha
I grabbed the times taken by GetPasswordsForForms using my personal account with > 50 passwords ...
7 years, 3 months ago (2013-09-05 01:16:11 UTC) #7
Raghu Simha
And here are the times taken by GetPasswordsForForms on startup for a test account with ...
7 years, 3 months ago (2013-09-05 19:59:15 UTC) #8
stuartmorgan
Sorry for the delay on reviewing this; I need to have a large block of ...
7 years, 3 months ago (2013-09-05 22:37:44 UTC) #9
Raghu Simha
Pinging once again, since we're hoping to be able to get this into the dev ...
7 years, 3 months ago (2013-09-12 22:04:05 UTC) #10
stuartmorgan
https://codereview.chromium.org/23477015/diff/32001/chrome/browser/password_manager/password_store_mac.cc File chrome/browser/password_manager/password_store_mac.cc (right): https://codereview.chromium.org/23477015/diff/32001/chrome/browser/password_manager/password_store_mac.cc#newcode466 chrome/browser/password_manager/password_store_mac.cc:466: // selective reads of only the passwords we're interested ...
7 years, 3 months ago (2013-09-18 19:23:31 UTC) #11
Raghu Simha
Stuart, thanks for the review. PTAL. https://codereview.chromium.org/23477015/diff/32001/chrome/browser/password_manager/password_store_mac.cc File chrome/browser/password_manager/password_store_mac.cc (right): https://codereview.chromium.org/23477015/diff/32001/chrome/browser/password_manager/password_store_mac.cc#newcode466 chrome/browser/password_manager/password_store_mac.cc:466: // selective reads ...
7 years, 3 months ago (2013-09-19 21:23:23 UTC) #12
Raghu Simha
Ping.
7 years, 2 months ago (2013-09-24 17:53:29 UTC) #13
Raghu Simha
Post-perf-deadline ping.
7 years, 2 months ago (2013-09-27 16:40:29 UTC) #14
stuartmorgan
https://codereview.chromium.org/23477015/diff/62002/chrome/browser/password_manager/password_store_mac.cc File chrome/browser/password_manager/password_store_mac.cc (right): https://codereview.chromium.org/23477015/diff/62002/chrome/browser/password_manager/password_store_mac.cc#newcode365 chrome/browser/password_manager/password_store_mac.cc:365: if (form_a.blacklisted_by_user || form_b.blacklisted_by_user) { As far as I ...
7 years, 2 months ago (2013-09-30 22:39:12 UTC) #15
Raghu Simha
Stuart, thanks again for the review. PTAL. https://codereview.chromium.org/23477015/diff/62002/chrome/browser/password_manager/password_store_mac.cc File chrome/browser/password_manager/password_store_mac.cc (right): https://codereview.chromium.org/23477015/diff/62002/chrome/browser/password_manager/password_store_mac.cc#newcode365 chrome/browser/password_manager/password_store_mac.cc:365: if (form_a.blacklisted_by_user ...
7 years, 2 months ago (2013-10-02 02:09:50 UTC) #16
Raghu Simha
Ping.
7 years, 2 months ago (2013-10-07 16:50:13 UTC) #17
stuartmorgan
LGTM with nits. https://codereview.chromium.org/23477015/diff/116001/chrome/browser/password_manager/password_store_mac.cc File chrome/browser/password_manager/password_store_mac.cc (right): https://codereview.chromium.org/23477015/diff/116001/chrome/browser/password_manager/password_store_mac.cc#newcode462 chrome/browser/password_manager/password_store_mac.cc:462: MacKeychainPasswordFormAdapter keychain_adapter(&keychain); It feels weird that ...
7 years, 2 months ago (2013-10-09 23:49:25 UTC) #18
Raghu Simha
Nits fixed. Will commit this via CQ after rebasing, running unit tests, and manually testing ...
7 years, 2 months ago (2013-10-10 00:32:18 UTC) #19
Raghu Simha
Thanks for the detailed review, Stuart. I've manually tested the latest CL to make sure ...
7 years, 2 months ago (2013-10-10 02:14:15 UTC) #20
commit-bot: I haz the power
No LGTM from a valid reviewer yet. Only full committers are accepted. Even if an ...
7 years, 2 months ago (2013-10-10 02:14:53 UTC) #21
stuartmorgan
On 2013/10/10 02:14:15, Raghu Simha wrote: > the time spent in loading 500 passwords from ...
7 years, 2 months ago (2013-10-10 03:00:55 UTC) #22
Ilya Sherman
On 2013/10/10 03:00:55, stuartmorgan wrote: > I have no idea why commit-bot doesn't think I'm ...
7 years, 2 months ago (2013-10-10 03:28:28 UTC) #23
Raghu Simha
7 years, 2 months ago (2013-10-10 17:28:34 UTC) #24
Message was sent while issue was closed.
Committed patchset #9 manually as r227954 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698