summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-01-08am c0221e7e: Merge "Allow to disable forced keep of annotated"Yohann Roussel
* commit 'c0221e7e7ef8e572d7e3ce4a1b66195b4f938f5b': Allow to disable forced keep of annotated
2015-01-08Merge "Allow to disable forced keep of annotated"Yohann Roussel
2015-01-08Allow to disable forced keep of annotatedYohann Roussel
We force all classes annotated with runtime annotation to be kept in the main dex list. This allow to workaround a Dalvik bug when accessing the annotations. But this increase the pressure in the main dex indexes. The new option is to allow to disable this workaround for application facing the index limit in their main dex and that don't access annotation at runtime or that have only annotations not subject to the resolution bug. Bug: 18928046 Change-Id: Ibcd7e579a7fef3451ec8aeb266ea67514d82cd50
2014-12-22Support --num-threads with --multi-dexPeter Jensen
The current dx implementation supports options --multi-dex, for applications not fitting within the dex format limitations; and --num-threads=N, triggers concurrent processing of multiple input files. However, the implementation has the following limitations: The --num-threads option is disabled when used together with --multi-dex. The --num-threads option implements concurrency at the level of classpath entries, and does nothing when the classes to be translated are specified with a single classpath element (e.g. single jar output from Proguard). The existing --num-threads implementation may produce indeterministic output. The heuristic used by the --multi-dex option to determine when to rotate the dex output file is overly conservative. The primary objective of this change is: Concurrent translation of classes, independently of input specification format. Support --num-threads=N in both mono- and multi-dex mode. Deterministic class output order. Near optimal use of dex file format capacity. This is accomplished by reorganizing the dx workflow in a pipeline of concurrent phases. read-class | parse-class | translate-class | add-to-dex | convert-dex-to-byte[]; output-dex-files-or-jar To manage dex file rotation (i.e. --multi-dex support), the parse-class and add-to-dex phases are synchronized to prevent forwarding classes to the translate-class phase if it could potentially result in breaking the dex format limitations. The heuristic currently used to estimate the number of indices needed for a class is improved, to minimize the amount of serialization imposed by this feedback mechanism, and to improve the use of dex file capacity. The translate-class and convert-dex-to-byte[] phases are further parallelized with configurable (--num-threads=N option) thread pools. This allow translating classes concurrently, while also performing output conversion in parallel. Separate collector threads are used to collect results from the thread pools in deterministic order. Testing was performed on an Ubuntu system, with 6 cores and 12 hardware threads. The taskset command was used to experimentally establish that running with more than 8 hardware threads does not provide any additional benefit. Experiments shows that the argument to --num-threads should not exceed the lesser of the number of available hardware threads, and 5. Setting it to a higher value results in no additional benefit. The gain is generally larger for larger applications, and not significant for small applications with less than a few thousands classes. Experiments with generated classes shows that for large applications gains as high as 50% may be possible. For an existing real-life application with more than 11k classes, and requiring 2 dex files, a speed-up of 37% was achieved (--num-threads=5, 8 hardware threads, 4g Java heap). A speedup of 31% was observed for another application with ~7 classes. For small applications, use of --num-threads=N>1 doesn’t provide significant benefit. Running with --num-threads=1, the modified dx is slightly faster, but no significant gain is observed unless the application requires multiple dex files. The one case where a significant regression may be observed is when using --num-threads=N>1, with a single hardware thread. This is an inappropriate configuration, even with the current implementation. However, because of the limitations of the current implementation, such configurations may exist. For instance, a configuration using both --multi-dex and --num-threads=5 will currently generate a warning about using the two options together. With the new implementation, the options can legitimately be used together, and could result in an ~20% regression running on a single hardware thread. Note: the current dx implementation, without --num-threads option, is already approximately 50% slower with 1 hardware thread, compared to running with 2 or more. With 2 hardware threads the implementations are practically at par (a little better, or a little worse, depending on the application). Testing: Tested with 6 existing applications ranging in size from 1K - 12K classes. Updated and tested with relevant existing unit tests (one test changed to account for better dex rotation heuristic). Added unit test to test deterministic output. Added unit performance test. By default run script merely validates that --multi-dex and --num-threads can be used together (fast). However, the test is configurable to perform performance test, over sets of generated classes. Change-Id: Ic2d11c422396e97171c2e6ceae9477113e261b8e Signed-off-by: Peter Jensen <jensenp@google.com>
2014-12-19am 3c5453aa: am e2808cf4: Merge "Do not keep the DexFile field in Main ↵Benoit Lamarche
between runs" * commit '3c5453aa09cf13e64750da6c0f0a499e0497002e': Do not keep the DexFile field in Main between runs
2014-12-19am e2808cf4: Merge "Do not keep the DexFile field in Main between runs"Benoit Lamarche
* commit 'e2808cf44a08f7e39163f79c9483c17602f58266': Do not keep the DexFile field in Main between runs
2014-12-19Merge "Do not keep the DexFile field in Main between runs"Benoit Lamarche
2014-12-17Do not keep the DexFile field in Main between runsBenoit Lamarche
Bug: 18486731 Change-Id: I76dbdd709182c4663f2bbf42179f55d0184e97c2
2014-12-02am ec36df18: am acc22d6b: am 8e88bab0: Keep annotated classes in main dex listYohann Roussel
* commit 'ec36df1895d5b2b4a830c03ba49312640322cb99': Keep annotated classes in main dex list
2014-12-02am acc22d6b: am 8e88bab0: Keep annotated classes in main dex listYohann Roussel
* commit 'acc22d6b761340ef99bd4be7b8db2bab868b3a88': Keep annotated classes in main dex list
2014-12-02am 8e88bab0: Keep annotated classes in main dex listlollipop-mr1-devYohann Roussel
* commit '8e88bab04f03edbbc74fb61b31a847c22106bfab': Keep annotated classes in main dex list
2014-12-01Keep annotated classes in main dex listYohann Roussel
Only classes annotated with a runtime visible annotation are to be kept. See https://code.google.com/p/android/issues/detail?id=78144 Bug: 18385117 (cherry picked from commit 893795fc95fdd77d398ebb77a0fe336c45b596cf) Change-Id: I46ceef4aab5119ba4515a07e8f17577e15931dbd
2014-11-28am accd504f: am c9548518: Merge "Keep annotated classes in main dex list"Yohann Roussel
* commit 'accd504f2f973b15f76885b218d93392f8e086bb': Keep annotated classes in main dex list
2014-11-28am c9548518: Merge "Keep annotated classes in main dex list"Yohann Roussel
* commit 'c95485186a5075e7568198c47e7290980353ce1c': Keep annotated classes in main dex list
2014-11-28Merge "Keep annotated classes in main dex list"android-wear-5.0.0_r1lollipop-wear-releaseYohann Roussel
2014-11-26Keep annotated classes in main dex listYohann Roussel
Only classes annotated with a runtime visible annotation are to be kept. See https://code.google.com/p/android/issues/detail?id=78144 Bug: 18385117 Change-Id: Id377b3945b22201ebad05e7cd026af57acc60292
2014-11-21am 37f5e351: am 3db80b57: Offer to exclude Zygote when converting heaps.Jeff Sharkey
* commit '37f5e351cee7aaf9162a1e9074af4b61079213cf': Offer to exclude Zygote when converting heaps.
2014-11-21am 3db80b57: Offer to exclude Zygote when converting heaps.Jeff Sharkey
* commit '3db80b5708eeae9194ff5dc44005efc8b2a726f1': Offer to exclude Zygote when converting heaps.
2014-11-20Offer to exclude Zygote when converting heaps.Jeff Sharkey
Dumps from Android devices have multiple heaps, including Zygote, image, etc. When investigating RAM usage, it's most useful to focus on "real" allocations from the app, ignoring the other heaps. This change introduces the "-z" flag which will drop allocations on non-app heaps during conversion. Bug: 18473132 Change-Id: Ib1d5256b7bc4cfd7791f00c18a1cff920e0e3f46
2014-11-20am 2d239127: am 3ef10cde: Merge "Use gnu++11 instead of c++11."Dan Albert
* commit '2d2391277d4a332c30cd1e89bae62df262041a11': Use gnu++11 instead of c++11.
2014-11-20am 3ef10cde: Merge "Use gnu++11 instead of c++11."Dan Albert
* commit '3ef10cde0867d5ee8f95931e4ecddb180f2d6829': Use gnu++11 instead of c++11.
2014-11-20Merge "Use gnu++11 instead of c++11."Dan Albert
2014-11-20Use gnu++11 instead of c++11.Dan Albert
libdex depends on safe-iop, which needs typeof, which is a GNU extension. Bug: 18466763 Change-Id: I11ff261991252feab49505c25249c43accfee4ab
2014-11-18am c012db68: am ec199fc9: Merge "Keep --input-list order."Xavier Ducrohet
* commit 'c012db68824ac2b6e13c209f432b514287335f10': Keep --input-list order.
2014-11-18am ec199fc9: Merge "Keep --input-list order."Xavier Ducrohet
* commit 'ec199fc9e406cc4ec7348b157d49b96d6897944b': Keep --input-list order.
2014-11-18Merge "Keep --input-list order."Xavier Ducrohet
2014-11-17am 0bc4145c: am 69e21184: Merge "Clean up some dead dalvik cruft."Elliott Hughes
* commit '0bc4145cf1ef206c3ede4d212f9b510421bf7544': Clean up some dead dalvik cruft.
2014-11-17am 69e21184: Merge "Clean up some dead dalvik cruft."Elliott Hughes
* commit '69e211844100e760646170c444f44f1064a48a77': Clean up some dead dalvik cruft.
2014-11-17Merge "Clean up some dead dalvik cruft."Elliott Hughes
2014-11-15Clean up some dead dalvik cruft.Elliott Hughes
I don't know whether dmtracedump is still useful, so I'm assuming we should keep it building. But at least now it's more obvious that it's the only user of Profile.h. Change-Id: Ieabce07cb278a19af72b566b08193db17d95e66d
2014-11-15am 4191557e: am 97479500: Keep --input-list order.Xavier Ducrohet
* commit '4191557ea3af887621cf6ad693a403fc78b72dd1': Keep --input-list order.
2014-11-15am 97479500: Keep --input-list order.Xavier Ducrohet
* commit '9747950064e4711c15baf0986102320a2512097a': Keep --input-list order.
2014-11-14Keep --input-list order.Xavier Ducrohet
Merging dex files starting with smaller ones can have a big impact on performance as it potentially reduces the number of compact events during the merge. Gradle will now send the list sorted in ascending order of file size, and dex should keep this order when parsing the input list file. Change-Id: Iff3ae4d30106fe70dca0764b33addfecceb84d09
2014-11-13Keep --input-list order.Xavier Ducrohet
Merging dex files starting with smaller ones can have a big impact on performance as it potentially reduces the number of compact events during the merge. Gradle will now send the list sorted in ascending order of file size, and dex should keep this order when parsing the input list file. Change-Id: Iff3ae4d30106fe70dca0764b33addfecceb84d09
2014-11-11am d1be1db4: am 9013f53c: Merge "kill HAVE_POSIX_FILEMAP"Yabin Cui
* commit 'd1be1db405c77d9aa0813639f79d622ac6c17d28': kill HAVE_POSIX_FILEMAP
2014-11-11am 9013f53c: Merge "kill HAVE_POSIX_FILEMAP"Yabin Cui
* commit '9013f53c778d11e7ba7a8bf745882a3e29fe938d': kill HAVE_POSIX_FILEMAP
2014-11-11Merge "kill HAVE_POSIX_FILEMAP"Yabin Cui
2014-11-11kill HAVE_POSIX_FILEMAPYabin Cui
Bug: 18315579 Change-Id: I2077b76ca7273fcaeaa91dda8d5365dd0e6f13e4
2014-11-06am 455584f2: am b929a279: am a1e4327e: Merge "Command line option for ↵Benoit Lamarche
disabling warnings" * commit '455584f258133e8c16288a4e5d597368ecf1dc81': Command line option for disabling warnings
2014-11-06am b929a279: am a1e4327e: Merge "Command line option for disabling warnings"Benoit Lamarche
* commit 'b929a2792bb5d3e661ec6925b20aa6e5512b7b34': Command line option for disabling warnings
2014-11-06am a1e4327e: Merge "Command line option for disabling warnings"Benoit Lamarche
* commit 'a1e4327e248e14a5358c644c63342916f7ab4ae5': Command line option for disabling warnings
2014-11-06Merge "Command line option for disabling warnings"Benoit Lamarche
2014-11-06Command line option for disabling warningsCsaba Kozák
This commit adds a new command line option to dx: --no-warning. If the caller appends this to the arguments, dx won't print warnings to System.err. This can be useful if the user dexes external jars with old class format, so dx would print lot of warning about those. Bug: https://code.google.com/p/android/issues/detail?id=78285 Change-Id: Ic2da274ec72e096bcf871c1f4512c54ddc228721 Signed-off-by: Csaba Kozák <kozakcsabi@gmail.com>
2014-11-01am ce498c6d: am 315b53e9: Add +x on mainDexClasses.Xavier Ducrohet
* commit 'ce498c6d18f8f31c76b4853a3ab0be41bddccb88': Add +x on mainDexClasses.
2014-11-01am 315b53e9: Add +x on mainDexClasses.Xavier Ducrohet
* commit '315b53e9eb8c92978e3b156caf0031ab3e77c9bf': Add +x on mainDexClasses.
2014-10-31Add +x on mainDexClasses.Xavier Ducrohet
Change-Id: Iaea2a8ec163cdfc50a5647e4071735675eee3481
2014-09-15am 20f7a88c: am 0bfe5322: Merge "Fix dexlist build"Brian Carlstrom
* commit '20f7a88c4c2b4917328d7ac3972da00f645ba906': Fix dexlist build
2014-09-15am 0bfe5322: Merge "Fix dexlist build"Brian Carlstrom
* commit '0bfe5322bdb29a3d4bb520073893dffa16dd17b3': Fix dexlist build
2014-09-15Merge "Fix dexlist build"android-l-preview_r2l-previewBrian Carlstrom
2014-09-14Fix dexlist buildBrian Carlstrom
Change-Id: If2ecee1254e8a8fa3eb22f27f8a850bb827f4b37