Preload native library when child process is created |
||||
Issue descriptionRight now libraries are loaded only after IChildProcessService.setupConnection() is called, which happens after we started loading a page. Library loading takes up to 200ms on 1GiB Android Go device, and delays other renderer initialization tasks. The idea here is to preload libraries (via NativeLibraryPreloader) when child process is created.
,
Nov 12 2017
Preloading only benefits warmed up child processes, if a child process is started in response to a request, there is no difference in the amount of work to load libraries, the work is just differently distributed (NativeLibraryPreloader is called from loadAlreadyLocked() vs called before loadAlreadyLocked()).
,
Nov 12 2017
Thick line at the left in all screenshots above is "NavigationTiming navigationStart".
,
Nov 13 2017
,
Nov 14 2017
Hi, Something that I don't quite understand intuitively is why the CPU duration is significantly lower than the task duration to load the library. Since this is done close to startup, loading the native library should not require any major page faults, as it was loaded a few seconds earlier for the browser process. So loading the library should be CPU-bound, meaning that we are actually getting descheduled here. In this case, doing more work earlier in the renderer process could actually slow things down by taking CPU time from it. Have you looked at time to commit for instance, to check that we don't regress?
,
Nov 15 2017
I've ran 50 times with/without preloading, and the results are too noisy to tell anything: https://docs.google.com/a/chromium.org/spreadsheets/d/1zFazntCMlo0gC9reQoUB1iAaeSAfAZDSywgNPd809Os/edit?usp=sharing I think we land this and then monitor perf bots / UMA, because logically this change should have positive impact. BTW, this is preloading, which simply calls android_dlopen_ext() [1], and doesn't run JNI_OnLoad. So it shouldn't touch many code pages (I believe we still have few global objects and other things that run during dlopen). [1] https://cs.corp.google.com/android/frameworks/base/native/webview/loader/loader.cpp?l=128
,
Nov 17 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e6857926630a26ae40009d7cf014970f717ffd56 commit e6857926630a26ae40009d7cf014970f717ffd56 Author: Dmitry Skiba <dskiba@chromium.org> Date: Fri Nov 17 20:09:35 2017 Preload native library when child process is bound. Library loading is the first thing that happens when a renderer starts navigating to a page. NativeLibraryPreloader is called during loading and is responsible for majority of the loading time. However, unlike library loading, preloading doesn't need to know command line of the child process, and thus can happen earlier. This CL preloads libraries when a child process is bound, which speeds up navigation for warmed up renderers. Bug: 783913 Change-Id: I3bffdc613717bfc61e038a2525cd96c5d0f0c0c3 Reviewed-on: https://chromium-review.googlesource.com/757561 Commit-Queue: Dmitry Skiba <dskiba@chromium.org> Reviewed-by: Bo <boliu@chromium.org> Reviewed-by: Richard Coles <torne@chromium.org> Cr-Commit-Position: refs/heads/master@{#517527} [modify] https://crrev.com/e6857926630a26ae40009d7cf014970f717ffd56/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java [modify] https://crrev.com/e6857926630a26ae40009d7cf014970f717ffd56/base/android/java/src/org/chromium/base/library_loader/NativeLibraryPreloader.java [modify] https://crrev.com/e6857926630a26ae40009d7cf014970f717ffd56/base/android/java/src/org/chromium/base/process_launcher/ChildProcessServiceDelegate.java [modify] https://crrev.com/e6857926630a26ae40009d7cf014970f717ffd56/base/android/java/src/org/chromium/base/process_launcher/ChildProcessServiceImpl.java [modify] https://crrev.com/e6857926630a26ae40009d7cf014970f717ffd56/base/test/android/java/src/org/chromium/base/MultiprocessTestClientServiceDelegate.java [modify] https://crrev.com/e6857926630a26ae40009d7cf014970f717ffd56/content/public/android/java/src/org/chromium/content/app/ContentChildProcessServiceDelegate.java [modify] https://crrev.com/e6857926630a26ae40009d7cf014970f717ffd56/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/TestChildProcessService.java
,
Nov 20 2017
,
Nov 26 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by dskiba@chromium.org
, Nov 12 20171.3 MB
1.3 MB Download
68.7 KB
68.7 KB View Download
1.4 MB
1.4 MB Download
68.8 KB
68.8 KB View Download
27.0 KB
27.0 KB View Download
11.3 KB
11.3 KB View Download