Closed
Bug 1153682
Opened 9 years ago
Closed 7 years ago
FxAccount storage on FxOS is very slow
Categories
(Firefox :: Firefox Accounts, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: markh, Unassigned)
Details
While looking into intermittent orange (bug 1151666), I discovered that use of signedInUser*.json is very slow. I instrumented the FxA code to report the times taken to read and write the data, and on the b2g emulator ("buildername": "b2g_emulator_vm try debug test xpcshell-2") I see things like: > 00:39:22 INFO - PROCESS | services/fxaccounts/tests/xpcshell/test_accounts.js | 1428651521542 FirefoxAccounts TRACE starting write of OAuth tokens: {"version":1,"uid":"1234@lcip.org","tokens":{}} The JSON at the end of the line above is exact what we are writing to signedInUserOAuthTokens.json... > 00:39:22 INFO - PROCESS | services/fxaccounts/tests/xpcshell/test_accounts.js | 1428651525210 FirefoxAccounts TRACE finished write of OAuth tokens - took: 3642 And it took 3.6 seconds! > 00:39:22 INFO - PROCESS | services/fxaccounts/tests/xpcshell/test_accounts.js | 1428651525244 FirefoxAccounts TRACE starting write of json user data: {"version":1,"accountData":{"email":"foo@example.com","uid":"1234@lcip.org","assertion":"foobar","sessionToken":"dead","kA":"beef","kB":"cafe","verified":true}} > 00:39:22 INFO - PROCESS | services/fxaccounts/tests/xpcshell/test_accounts.js | 1428651525684 FirefoxAccounts TRACE finished write of json user data - took: 422 Ditto above, taking .4 seconds, meaning there is 4 seconds total writing account data. Similarly when writing null: > 00:39:22 INFO - PROCESS | services/fxaccounts/tests/xpcshell/test_accounts.js | 1428651525961 FirefoxAccounts TRACE starting write of OAuth tokens: null > 00:39:22 INFO - PROCESS | services/fxaccounts/tests/xpcshell/test_accounts.js | 1428651526380 FirefoxAccounts TRACE finished write of OAuth tokens - took: 410 > 00:39:22 INFO - PROCESS | services/fxaccounts/tests/xpcshell/test_accounts.js | 1428651526399 FirefoxAccounts TRACE starting write of json user data: null > 00:39:22 INFO - PROCESS | services/fxaccounts/tests/xpcshell/test_accounts.js | 1428651526718 FirefoxAccounts TRACE finished write of json user data - took: 293 So "only" 0.7 seconds to write 2 files with exactly "null". Note this is a debug build on an emulator, and not all IO operations are quite this bad, but it still might reflect something bad we need to address. Yoric, do you have any OS.File or general perf insights here? FTR, the code that does the save of the tokens is https://dxr.mozilla.org/mozilla-central/source/services/fxaccounts/FxAccounts.jsm#1433 (which is where I added the instrumentation), which calls https://dxr.mozilla.org/mozilla-central/source/services/common/utils.js#400, which calls OS.File.writeAtomic() Note also I've no real suggestion for what actions we should take - use telemetry to see how slow it really is in the field? Use different storage? Ignore it?
There are indeed suspicions of OS.File slowness on B2G: bug 1079454. I have no clear idea how to investigate this. From the top of my mind, here are a few possible culprits: 1. some bad interaction between low-level OS.File code and Android libc; 2. bug 927560 has shutdown OS.File and restarting it is very slow; 3. performance issue with ChromeWorker. Actually, to test for 2., the simplest would be to remove pref osfile.reset_worker_delay from b2g and see if this changes anything. I'm not familiar at all with the b2g workflow, though, so I'm not going to be able to lead the charge on this investigation.
Reporter | ||
Comment 2•7 years ago
|
||
RIP FxOS
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Updated•6 years ago
|
Product: Core → Firefox
You need to log in
before you can comment on or make changes to this bug.
Description
•