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

Side by Side Diff: build/android/gyp/dex.py

Issue 1319523002: Reland: Use --num-thread=10 when dexing Android code (saves 5 seconds) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment & rebase Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 import logging 7 import logging
8 import optparse 8 import optparse
9 import os 9 import os
10 import sys 10 import sys
(...skipping 30 matching lines...) Expand all
41 for i in iz.namelist(): 41 for i in iz.namelist():
42 if i.endswith('.dex'): 42 if i.endswith('.dex'):
43 oz.writestr(i, iz.read(i)) 43 oz.writestr(i, iz.read(i))
44 os.remove(options.dex_path) 44 os.remove(options.dex_path)
45 os.rename(tmp_dex_path, options.dex_path) 45 os.rename(tmp_dex_path, options.dex_path)
46 46
47 47
48 def DoDex(options, paths, dex_args=None): 48 def DoDex(options, paths, dex_args=None):
49 dx_binary = os.path.join(options.android_sdk_tools, 'dx') 49 dx_binary = os.path.join(options.android_sdk_tools, 'dx')
50 # See http://crbug.com/272064 for context on --force-jumbo. 50 # See http://crbug.com/272064 for context on --force-jumbo.
51 dex_cmd = [dx_binary, '--dex', '--force-jumbo', '--output', options.dex_path] 51 # See https://github.com/android/platform_dalvik/commit/dd140a22d for
52 # --num-threads.
53 dex_cmd = [dx_binary, '--num-threads=8', '--dex', '--force-jumbo',
54 '--output', options.dex_path]
52 if options.no_locals != '0': 55 if options.no_locals != '0':
53 dex_cmd.append('--no-locals') 56 dex_cmd.append('--no-locals')
54 57
55 if dex_args: 58 if dex_args:
56 dex_cmd += dex_args 59 dex_cmd += dex_args
57 60
58 dex_cmd += paths 61 dex_cmd += paths
59 62
60 record_path = '%s.md5.stamp' % options.dex_path 63 record_path = '%s.md5.stamp' % options.dex_path
61 md5_check.CallAndRecordIfStale( 64 md5_check.CallAndRecordIfStale(
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 131
129 if options.depfile: 132 if options.depfile:
130 build_utils.WriteDepfile( 133 build_utils.WriteDepfile(
131 options.depfile, 134 options.depfile,
132 paths + build_utils.GetPythonDependencies()) 135 paths + build_utils.GetPythonDependencies())
133 136
134 137
135 138
136 if __name__ == '__main__': 139 if __name__ == '__main__':
137 sys.exit(main()) 140 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698