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

Unified Diff: build/android/method_count.py

Issue 2244653003: 🚀 Add dex info and static initializers to resource_sizes.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add dex info and static initializers to resource_sizes.py Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/android/resource_sizes.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/method_count.py
diff --git a/build/android/method_count.py b/build/android/method_count.py
index fdbdaf5606f969a6fae5f5f04f8e0d23c48cf43d..1d9720c97ef9531a955176aa3217b4dffc025b7c 100755
--- a/build/android/method_count.py
+++ b/build/android/method_count.py
@@ -48,10 +48,10 @@ import perf_tests_results_helper # pylint: disable=import-error
# https://source.android.com/devices/tech/dalvik/dex-format.html
-_CONTRIBUTORS_TO_DEX_CACHE = {'type_ids_size': 'types',
- 'string_ids_size': 'strings',
- 'method_ids_size': 'methods',
- 'field_ids_size': 'fields'}
+CONTRIBUTORS_TO_DEX_CACHE = {'type_ids_size': 'types',
+ 'string_ids_size': 'strings',
+ 'method_ids_size': 'methods',
+ 'field_ids_size': 'fields'}
def _ExtractSizesFromDexFile(dex_path):
@@ -61,7 +61,7 @@ def _ExtractSizesFromDexFile(dex_path):
# Each method, type, field, and string contributes 4 bytes (1 reference)
# to our DexCache size.
counts['dex_cache_size'] = (
- sum(counts[x] for x in _CONTRIBUTORS_TO_DEX_CACHE)) * 4
+ sum(counts[x] for x in CONTRIBUTORS_TO_DEX_CACHE)) * 4
return counts
m = re.match(r'([a-z_]+_size) *: (\d+)', line)
if m:
@@ -69,7 +69,7 @@ def _ExtractSizesFromDexFile(dex_path):
raise Exception('Unexpected end of output.')
-def _ExtractSizesFromZip(path):
+def ExtractSizesFromZip(path):
tmpdir = tempfile.mkdtemp(suffix='_dex_extract')
try:
counts = collections.defaultdict(int)
@@ -109,7 +109,7 @@ def main():
'and --apk-name was not provided.' % args.dexfile)
if os.path.splitext(args.dexfile)[1] in ('.zip', '.apk', '.jar'):
- sizes = _ExtractSizesFromZip(args.dexfile)
+ sizes = ExtractSizesFromZip(args.dexfile)
else:
sizes = _ExtractSizesFromDexFile(args.dexfile)
@@ -118,7 +118,7 @@ def main():
'%s_%s' % (args.apk_name, name), 'total', [sizes[value_key]],
description or name)
- for dex_header_name, readable_name in _CONTRIBUTORS_TO_DEX_CACHE.iteritems():
+ for dex_header_name, readable_name in CONTRIBUTORS_TO_DEX_CACHE.iteritems():
print_result(readable_name, dex_header_name)
print_result(
'DexCache_size', 'dex_cache_size', 'bytes of permanent dirty memory')
« no previous file with comments | « no previous file | build/android/resource_sizes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698