inline functions might make it faster: As shown
above<!--rawtext:[9.2]:rawtext-->, procedural integration might remove
a bunch of unnecessary instructions, which might make things run faster.
inline functions might make it slower: Too much inlining
might cause code bloat, which might cause "thrashing" on demand-paged
virtual-memory systems. In other words, if the executable size is too big,
the system might spend most of its time going out to disk to fetch the next
chunk of code.
inline functions might make it larger: This is the
notion of code bloat, as described above. For example, if a system has 100
inline functions each of which expands to 100 bytes of executable code
and is called in 100 places, that's an increase of 1MB. Is that 1MB going to
cause problems? Who knows, but it is possible that that last 1MB could cause
the system to "thrash," and that could slow things down.
inline functions might make it smaller: The compiler
often generates more code to push/pop registers/parameters than it would by
inline-expanding the function's body. This happens with very small functions,
and it also happens with large functions when the optimizer is able to remove
a lot of redundant code through procedural integration — that is, when the
optimizer is able to make the large function small.
inline functions might cause thrashing: Inlining might
increase the size of the binary executable, and that might cause thrashing.
inline functions might prevent thrashing: The working
set size (number of pages that need to be in memory at once) might go down
even if the executable size goes up. When <nobr><tt>f()</tt></nobr> calls <nobr><tt>g()</tt></nobr>, the
code is often on two distinct pages; when the compiler procedurally integrates
the code of <nobr><tt>g()</tt></nobr> into <nobr><tt>f()</tt></nobr>, the code is often on the same page.
inline functions might increase the number of cache
misses: Inlining might cause an inner loop to span across multiple
lines of the memory cache, and that might cause thrashing of the memory-cache.
inline functions might decrease the number of cache
misses: Inlining usually improves locality of reference within the
binary code, which might decrease the number of cache lines needed to store
the code of an inner loop. This ultimately could cause a CPU-bound
application to run faster.
inline functions might be irrelevant to speed: Most
systems are not CPU-bound. Most systems are I/O-bound, database-bound or
network-bound, meaning the bottleneck in the system's overall performance is
the file system, the database or the network. Unless your "CPU meter" is
pegged at 100%, inline functions probably won't make your system
faster. (Even in CPU-bound systems, inline will help only when used
within the bottleneck itself, and the bottleneck is typically in only a small
percentage of the code.)
分享到:
相关推荐
三内联函数inlinefunction四引用和数值传递方式具体PPT课件.pptx
三内联函数inlinefunction四引用和数值传递方式具体学习教案.pptx
三内联函数inlinefunction四引用和数值传递方式具体PPT学习教案.pptx
内联函数(Inline Function) 其他 解构声明(Destructuring Declaration) 集合(Collection) 值范围(Range) 类型检查与类型转换 this 表达式 相等判断 操作符重载(Operator overloading) Null 值安全性 异常(Exception)...
Inline function is like a macro definition. When it was be called in another function, the control right will not be changed to this function. The compiler will just replace the line of inline ...
Inline Function Expansion for Compiling C ProgramsWen-mei W. Hwu and Pohua P. ChangCoordinated Science Laboratory University of Illinois1101 W. Springfield Ave. Urbana, IL 61801 (217) 244-8270hwu@...
php的memcache扩展,linux下的,php的memcache扩展分为两种,一种是memcache,一种是基于libmemcached的memcached,这个是memcache版本的beta版本
Inline function Included You can subscribe on event by calling: val EVENT_CALL_ONE = "simple_event_name" val eventListener = ::eventHandler val priority = 1 KDispatcher.subscribe(EVENT_CALL_ONE, ...
cJSON案例及源文件
前段时间被IE和JavaScript脚本...function foo(){ // TODO: . . . return x;} 可以说是在熟悉不过了。当然除了这种定义函数的方法,我们还有另外几种方法也能定义函数: var foo = function(){ // TODO: .
Header Files The #define Guard Header File Dependencies Inline Functions The -inl.h Files Function Parameter Ordering Names and Order of Includes Scoping Namespaces Nested Classes Nonmember, Static ...
GoJSON GoJSON是一个快速而简单的包,用于在 json 中编组/解组结构体。 您可以使用GoJSON工具生成编组/解组代码,在基准测试中, GoJSON的生成... - inline Use inline function in generate code ( default true ) -
这种在函数调用处直接嵌入函数体的函数称为内联函数(inline function),又称内嵌函数或内嵌函数。 指定内联函数的方法很简单,只需要在定义函数时增加 inline 关键字。 注意:是在函数定义时增加 inline 关键字,...
#Kotlin基础研究 介绍 Kotlin语 开发环境 基本 变量和数据类型- 功能- ... 内联函数-InlineFunction 扩展功能-ExtensionFunction 缀功能- InfixFunction 高阶函数-HighOrderFunction 基于阵列
功能码 将函数转换为字符串npm install function-...}(2,2))functionCode.inline(fn,args ...) var functionCode = require ( 'function-code' ) ;console . log ( functionCode . inline ( function ( a , b ) {
gulp-css-inline-images ... task ( 'inline-images' , function ( ) { gulp . src ( '*.css' ) . pipe ( cssInlineImages ( { webRoot : 'web' , path : 'images' } ) ) . pipe ( gulp . dest ( 'buil
节点内联 内联网页的所有图像,样式表和脚本。 这是的(部分)端口到我的模块。 安装 npm i inline 用法 var Inline = require ( "inline" ) , minreq = require ( "minreq" ... } , function ( err , data ) { if
.button{display:inline;float:right;font-size:12px;cursor:pointer} </style> <body><div id="rbbox">()">关闭</a><iframe src="1.jpg" height="200" width="300" scrolling="no" ></iframe></div> </body> ...
gulp-内联-css 获取 HTML 样式标签并使用 ... task ( 'inliner' , function ( ) { gulp . src ( 'client/html/*.html' ) . pipe ( inline ( APIKEY ) ) . pipe ( gulp . dest ( 'dist/email' ) ;} ) ;应用程序接口内