㈠ 应用编译优化有什么用
应用编译优化的作用是:提高运行能力因为程序优化前,有3个变量需要3个寄存器,一次乘法运算。程序优化后,只有1个变量需要一个寄存器,没有乘法运算。
并且这个优化看起来很微不足道,但实际上用途很广。为了程序的可读性和可维护性,大多数程序员应该还是会选用第一种方式。
写3行程序而不是直接甩下一行int ticks = 491520让后来读程序的人摸不到头脑。有了编译器的优化,程序员既可以写出易读的程序又不必担心性能受影响。
尤其是在嵌入式领域,很多低端芯片根本就没有硬件乘法器,如果程序不做上述优化可能这3行代码需要几十个cycle,优化过后一个cycle就搞定。
应用编译优化的级别:
第一级:代码调整。
代码调整是一种局部的思维方式;基本上不触及算法层级;它面向的是代码,而不是问题; 所以:语句调整,用汇编重写、指令调整、换一种语言实现、换一个编译器、循环展开、参数传递优化等都属于这一级。
第二级:新的视角。
新的视角强调的重点是针对问题的算法;即选择和构造适合于问题的算法。
第三级:表驱动状态机。
将问题抽象为另一种等价的数学模型或假想机器模型,比如构造出某种表驱动状态机;这一级其实是第二级的延伸,只是产生的效果更加明显,但它有其本身的特点。
㈡ 编译器 优化
编译是从源代码(通常为高阶语言)到能直接被计算机或虚拟机执行的目标代码(通常为低阶语言或机器语言)的翻译过程。然而,也存在从低阶语言到高阶语言的编译器,这类编译器中用来从由高阶语言生成的低阶语言代码重新生成高阶语言代码的又被叫做反编译器。也有从一种高阶语言生成另一种高阶语言的编译器,或者生成一种需要进一步处理的的中间代码的编译器(又叫级联)。
典型的编译器输出是由包含入口点的名字和地址, 以及外部调用(到不在这个目标文件中的函数调用)的机器代码所组成的目标文件。一组目标文件,不必是同一编译器产生,但使用的编译器必需采用同样的输出格式,可以链接在一起并生成可以由用户直接执行的可执行程序。
从他的原理我们就好优化了,但是方法很多的
㈢ 应用编译优化哪个模式好
即时编译技术。
JIT为“即时编译技术”,当App运行时,每当遇到一个新类,JIT编译器就会对这个类进行编译,经过编译后的代码,会被优化成相当精简的原生型指令码(即nativecode),这样在下次执行到相同逻辑的时候,速度就会更快。
㈣ java 编译优化问题
java编译的结果是字节码而不是二进制,所以在运行时vm的优化才是重要的,包括VM的回收策略、分配给VM内存的大小都能在一定程度上影响性能。Sun的VM支持热点编译,对高频执行的代码段翻译的2进制会进行缓存,这也是VM的一种优化。
IBM JVM处理数学运算速度最快,BEA JVM处理大量线程和网络socket性能最好,而Sun JVM处理通常的商业逻辑性能最好。不过Hotspot的Server mode被报告有稳定性的问题。
Java 的最大优势不是体现在执行速度上,所以对Compiler的要求并不如c++那样高,代码级的优化还需要程序员本身的功底。
贴个java的运行参数:
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-client to select the "client" VM
-server to select the "server" VM
-hotspot is a synonym for the "client" VM [deprecated]
The default VM is client.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print proct version and exit
-version:<value>
require the specified version to run
-showversion print proct version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see
java.lang.instrument
-Xmixed mixed mode execution (default)
-Xint interpreted mode execution only
-Xbootclasspath:<directories and zip/jar files separated by ;>
set search path for bootstrap classes and resources
-Xbootclasspath/a:<directories and zip/jar files separated by ;>
append to end of bootstrap class path
-Xbootclasspath/p:<directories and zip/jar files separated by ;>
prepend in front of bootstrap class path
-Xnoclassgc disable class garbage collection
-Xincgc enable incremental garbage collection
-Xloggc:<file> log GC status to a file with time stamps
-Xbatch disable background compilation
-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
-Xss<size> set java thread stack size
-Xprof output cpu profiling data
-Xfuture enable strictest checks, anticipating future default
-Xrs rece use of OS signals by Java/VM (see
documentation)
-Xcheck:jni perform additional checks for JNI functions
-Xshare:off do not attempt to use shared class data
-Xshare:auto use shared class data if possible (default)
-Xshare:on require using shared class data, otherwise fail.
Java虚拟机(JVM)参数配置说明
在Java、J2EE大型应用中,JVM非标准参数的配置直接关系到整个系统的性能。
JVM非标准参数指的是JVM底层的一些配置参数,这些参数在一般开发中默认即可,不需
要任何配置。但是在生产环境中,为了提高性能,往往需要调整这些参数,以求系统达
到最佳新能。
另外这些参数的配置也是影响系统稳定性的一个重要因素,相信大多数Java开发人员都
见过“OutOfMemory”类型的错误。呵呵,这其中很可能就是JVM参数配置不当或者就没
有配置没意识到配置引起的。
为了说明这些参数,还需要说说JDK中的命令行工具一些知识做铺垫。
首先看如何获取这些命令配置信息说明:
假设你是windows平台,你安装了J2SDK,那么现在你从cmd控制台窗口进入J2SDK安装目
录下的bin目录,然后运行java命令,出现如下结果,这些就是包括java.exe工具的和
JVM的所有命令都在里面。
-----------------------------------------------------------------------
D:\j2sdk15\bin>java
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-client to select the "client" VM
-server to select the "server" VM
-hotspot is a synonym for the "client" VM [deprecated]
The default VM is client.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print proct version and exit
-version:<value>
require the specified version to run
-showversion print proct version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see
java.lang.instrument
-----------------------------------------------------------------------
在控制台输出信息中,有个-X(注意是大写)的命令,这个正是查看JVM配置参数的命
令。
其次,用java -X 命令查看JVM的配置说明:
运行后如下结果,这些就是配置JVM参数的秘密武器,这些信息都是英文的,为了方便
阅读,我根据自己的理解翻译成中文了(不准确的地方还请各位博友斧正)
-----------------------------------------------------------------------
D:\j2sdk15\bin>java -X
-Xmixed mixed mode execution (default)
-Xint interpreted mode execution only
-Xbootclasspath:<directories and zip/jar files separated by ;>
set search path for bootstrap classes and resources
-Xbootclasspath/a:<directories and zip/jar files separated by ;>
append to end of bootstrap class path
-Xbootclasspath/p:<directories and zip/jar files separated by ;>
prepend in front of bootstrap class path
-Xnoclassgc disable class garbage collection
-Xincgc enable incremental garbage collection
-Xloggc:<file> log GC status to a file with time stamps
-Xbatch disable background compilation
-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
-Xss<size> set java thread stack size
-Xprof output cpu profiling data
-Xfuture enable strictest checks, anticipating future default
-Xrs rece use of OS signals by Java/VM (see
documentation)
-Xcheck:jni perform additional checks for JNI functions
-Xshare:off do not attempt to use shared class data
-Xshare:auto use shared class data if possible (default)
-Xshare:on require using shared class data, otherwise fail.
The -X options are non-standard and subject to change without notice.
-----------------------------------------------------------------------
JVM配置参数中文说明:
-----------------------------------------------------------------------
1、-Xmixed mixed mode execution (default)
混合模式执行
2、-Xint interpreted mode execution only
解释模式执行
3、-Xbootclasspath:<directories and zip/jar files separated by ;>
set search path for bootstrap classes and resources
设置zip/jar资源或者类(.class文件)存放目录路径
3、-Xbootclasspath/a:<directories and zip/jar files separated by ;>
append to end of bootstrap class path
追加zip/jar资源或者类(.class文件)存放目录路径
4、-Xbootclasspath/p:<directories and zip/jar files separated by ;>
prepend in front of bootstrap class path
预先加载zip/jar资源或者类(.class文件)存放目录路径
5、-Xnoclassgc disable class garbage collection
关闭类垃圾回收功能
6、-Xincgc enable incremental garbage collection
开启类的垃圾回收功能
7、-Xloggc:<file> log GC status to a file with time stamps
记录垃圾回日志到一个文件。
8、-Xbatch disable background compilation
关闭后台编译
9、-Xms<size> set initial Java heap size
设置JVM初始化堆内存大小
10、-Xmx<size> set maximum Java heap size
设置JVM最大的堆内存大小
11、-Xss<size> set java thread stack size
设置JVM栈内存大小
12、-Xprof output cpu profiling data
输入CPU概要表数据
13、-Xfuture enable strictest checks, anticipating future default
执行严格的代码检查,预测可能出现的情况
14、-Xrs rece use of OS signals by Java/VM (see
documentation)
通过JVM还原操作系统信号
15、-Xcheck:jni perform additional checks for JNI functions
对JNI函数执行检查
16、-Xshare:off do not attempt to use shared class data
尽可能不去使用共享类的数据
17、-Xshare:auto use shared class data if possible (default)
尽可能的使用共享类的数据
18、-Xshare:on require using shared class data, otherwise fail.
尽可能的使用共享类的数据,否则运行失败
The -X options are non-standard and subject to change without notice.
㈤ 清浊应用编译优化怎么用
清浊是一个有点实用的清理类app,下载后点击三角键即可开始清理。
因为在我的日常清理中我需要自定义目录的清理,所以写了这么一个app,当然实用性也很强,可以通过加载任务完成所需要的清理,一些基本功能像空目录清理、卸载残留清理也包含在内了。
服务器为大家提供了基本的清理任务,可以自行加载,当然清浊目前还是第一个版本难免有一些问题什么的,以后会有越来越多的规则加入,功能也会越来越丰富呢,快来试试吧。
2021.10.07 v1.7.7版本更新说明:
1、干掉文件夹,安卓11可以访问【android/data】并干掉其中的文件夹、
2、排除项加了个排除应用的功能,只排除应用清理的时候哦。其他时候不排除,,注意,长按按钮可以展开按钮然后添加应用。
3、应用编译改了下,上个版本没加长按全部编译。
4、文件大小分析安卓11【android/data】不能进去的问题搞定。
5、文件分类分析,删除文件闪退问题。
6、选择项的选择框,加大了一点范围。
7、应用冻结,选择应用不再排除已经冻结的应用,因为出现了,暂时不知道原因的,冻结列表丢失的问题,暂时没找到原因。
8、一些像隐私政策文本显示不能滑动出错的问题
9、其他闪退的问题,列表点击闪退的问题。
㈥ 安卓手机怎么设置 手机系统设置 手机性能才能提到最高
可以通过开启发者选项,并对开发者选项相关项进行优化设置,提高手机的流畅性。
(以小米手机为例)MIUI有很多的这样的功能,具体是菜单跳转的渐进渐出,窗口关闭与打开时的过渡效果等,虽然过渡的不是很慢,这个功能是在开发者选项里面设置,默认MIUI是隐藏了开发者选项的,如何开启开发者选项以及如何设置过渡动画可以按以下教程:
1、在手机主屏找到设置->关于手机。
5、如果将上面的效果设置为2,再返回去操作就会发现,比如打开设置,再点开其它菜单就会显得慢,会有渐入的感觉,让人觉得不能忍受,改到0.5或者关闭就快多了,直接弹出下一级菜单。
㈦ 如何反编译android应用以及重编译,签名和对齐优化
工具/原料
电脑必须装JAVA
JAVA电脑环境教程
apktool
方法/步骤
1. 配置好JAVA环境变量,下载:apktool 解压的文件放在C盘根目录的apktool文件夹里(apktool文件夹自己创立)
打开命令提示符,(开始-运行-输入cmd)
2. 输入:cd \apktool 系统指令到了apktool文件夹(这里就是为什么要把解压的apktool解压的文件放到apktool文件夹的原因,当然你也可以自命名文件夹的名称,那么比如arc,那么指令就变成了:cd \arc 前提是你必须把apktool解压的文件放到这个文件夹里面)
3. 使用RE管理器把系统里面的framework-res.apk 与 SystemUI.apk 提取出来放在apktool文件夹里面
4. 如果只是想反编译framework-res.apk
输入apktool if framework-res.apk(框架的建立)
5. 开始最重要的反编译,输入指令,apktool d framework-res.apk
(反编辑的APK一定要用没换过图片的,否则回编辑失败)
6. 最后反编译完成
7. 修改代码完成后,输入代码:apktool d framework-res 即可完成回编译
8. 如果反编译的是系统文件,比如,SystemUI.apk 那么必须进行挂载框架,反编译时,必须敲入一下命令:(然后再重复4-7步骤)
apktool if framework-res.apk
apktool if SystemUI.apk
9. 对于三星手机(比如9100、9108/9100G),如果反编译SystemUI.apk要敲入一下命令进行框架挂载apktool if framework-res.apk
apktool if twframework-res.apk
apktool if SystemUI.apk
10. 回编译的命令是 apktool b XXX (没有后面的apk后缀)反编译的命令是 apktool d xxx (有后面的apk)
㈧ 编译器的编译器优化
应用程序之所以复杂, 是由于它们具有处理多种问题以及相关数据集的能力。实际上, 一个复杂的应用程序就象许多不同功能的应用程序“ 粘贴” 在一起。源文件中大部分复杂性来自于处理初始化和问题设置代码。这些文件虽然通常占源文件的很大一部分, 具有很大难度, 但基本上不花费C PU 执行周期。
尽管存在上述情况, 大多数Makefile文件只有一套编译器选项来编译项目中所有的文件。因此, 标准的优化方法只是简单地提升优化选项的强度, 一般从O 2 到O 3。这样一来, 就需要投人大量 精力来调试, 以确定哪些文件不能被优化, 并为这些文件建立特殊的make规则。
一个更简单但更有效的方法是通过一个性能分析器, 来运行最初的代码, 为那些占用了85 一95 % CPU 的源文件生成一个列表。通常情况下, 这些文件大约只占所有文件的1%。如果开发人员立刻为每一个列表中的文件建立其各自的规则, 则会处于更灵活有效的位置。这样一来改变优化只会引起一小部分文件被重新编译。进而,由于时间不会浪费在优化不费时的函数上, 重编译全部文件将会大大地加快。
㈨ 的编译优化功能:有没有部分不优化的方法,该如何处理
keil-project-options for target-选项卡c/c++ 左侧中间有个optimization 后面的对应的就是编译优化设置level 0就是不优化