New issue
Advanced search Search tips

Issue 779162 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

usb_ids_gen.cc is vacuously compiled on Android.

Project Member Reported by hua...@chromium.org, Oct 27 2017

Issue description

usb_ids_gen.cc is a generated 20K-line file containing USB ids and strings. For Android, its contents are compiled, but mostly not linked into the final APK.

- For Supersize archive, only ~150 / 15000 strings found appear in the final APK. This adds 10's of seconds to Supersize executation.
- This wastes compile resources.

We should just skip compiling the unused data for Clank builds.
 

Comment 1 by hua...@chromium.org, Oct 27 2017

Perhaps we can change usb_ids_gen.cc generation code to simply not print all the data when not needed (i.e., Android)?

Comment 2 by hua...@chromium.org, Oct 27 2017

Cc: reillyg@chromium.org
Owner: hua...@chromium.org
Assigning to myself.

Turns out usb_util.cc already excludes usb_ids.h for Android. So it suffices to take a step further: edit BUILD.gn to and exclude compile for Android.

Doing this reduces Supersize archive (x86) on my machine from ~45s to ~31s.
sgtm, send me a patch.
Project Member

Comment 4 by bugdroid1@chromium.org, Oct 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2cb0922daf3077ef449be6728742e0f5396481b4

commit 2cb0922daf3077ef449be6728742e0f5396481b4
Author: Samuel Huang <huangs@chromium.org>
Date: Mon Oct 30 18:37:00 2017

[USB] Exclude usb_ids.* compilation for Chrome under Android.

Clank build excludes usb_ids.*, but the source files (inlcude the giant
file usb_ids_gen.cc) still got compiled, even though its results are not
included in the final APK. This adds unnecessary work for Clank builds,
and creates overhead to Supersize archive command. This CL removes these
vacuous usb_ids.* compilation under Android. This speeds up Supersize
archive by about 20% (and probably shaves seconds from Clank build).

Bug:  779162 
Change-Id: I4e4a9eb4274bfa9d298a5ce887179629a5cb6b7f
Reviewed-on: https://chromium-review.googlesource.com/740688
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512538}
[modify] https://crrev.com/2cb0922daf3077ef449be6728742e0f5396481b4/device/BUILD.gn
[modify] https://crrev.com/2cb0922daf3077ef449be6728742e0f5396481b4/device/usb/BUILD.gn

Status: Fixed (was: Assigned)

Sign in to add a comment