您好,欢迎光临本网站![请登录][注册会员]  
文件名称: android lint performance probe帮助.zip
  所属分类: 其它
  开发工具:
  文件大小: 67kb
  下载次数: 0
  上传时间: 2019-09-24
  提 供 者: weixin_********
 详细说明: This is a simple tool to help pinpoint performance bottlenecks in individual Android Lint checks. It uses Java byte code instrumentation to collect and report performance statistics per detector for a Lint analysis invoked from Gradle. It relies on YourKit Probes to do the byte code instrumentation part, although in principle altern ative instrumentation agents could be used. This tool was involved in the 2x-level Lint performance improvements that landed with the Android Studio 3.3 release; theres a blog post with more details. Getting started This tool requires a valid YourKit installation. YourKit is a paid profiler, although trial versions are available. Once YourKit is installed, edit the properties in gradle.properties to point to the corresponding files in your YourKit installation. You will need to set both the yourkitJar property and the yourkitAgent property. Next, run to compile the tool and print out the JVM arguments needed to instrument Lint. Heres an example of what those JVM arguments will look like: Add the generated arguments to your Gradle JVM arguments in an Android project. (See Gradle documentation for how to set the org.gradle.jvmargs property.) Finally, invoke Lint from Gradle as you normally do. Once Lint finishes, performance statistics for each Lint detector should be printed to the console. Heres some sample output: Memory allocation instrumentation The tool also supports measuring memory allocations through the use of an allocation instrumentation agent. To enable this, generate the JVM arguments with this command instead: Heres some sample output: Troubleshooting If you get strange error messages from the Gradle JVM, double check that the JVM arguments are formatted and quoted properly. Quoting may be needed if there are spaces in the file paths, for example. Similarly, be aware that typos in the JVM arguments may cause YourKit to silently ignore the probe. If the JVM arguments have been applied properly but you still dont see performance stats output, its worth checking to see if YourKit has reported any errors---especially if youve made code changes to the probe. To do this, run java with the JVM arguments generated by this tool. YourKit should print a line to standard error like this. Open that log file to see if there were any errors reported. For example, if you added a malformed regular expression to the MethodPattern annotation in LintDetectorStats.java, you might see a line like this. Conversely, its a good sign if you see a line like this. If you make code changes to the tool, be sure to run ./gradlew assemble in order to rebuild the probe. Also, be sure to start a new Gradle daemon for Lint; otherwise the old version of the tool could still be in use. This is easy to do by using the --no-daemon Gradle flag. Notes and tips The tool will print out three columns for each detector: total shows the total amount of time spent within any method in that detector self is similar to total, but it excludes any time spent in other instrumented callees calls shows the number of calls to any method in that detector In addition to individual Lint detectors, the tool also instruments LintDriver and TopDownAnalyzerFacadeForJVM. LintDriver drives the entire Lint analysis, so it will help show the total time spent in Lint. TopDownAnalyzerFacadeForJVM is essentially the entry point into the Kotlin compiler, so it is a good proxy for how much time is spent upfront analyzing a Kotlin module before Lint detectors can start. To include your own custom Lint checks in the output of the tool, you can add to the list of regular expressions in LintDetectorStats.java. Be aware that caching effects may distort the performance stats for individual detectors. For example, the first Lint check to run might get the blame for the initial cache misses when resolving calls, types, etc.
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索:
 输入关键字,在本站1000多万海量源码库中尽情搜索: