out返回值的方法和方法 [英] out method and method with return value
问题描述
在性能方面,当有一个值返回时使用成本更高?
是out方法参数还是具有返回值的方法?
In performance wise which is more costly to use when there one value to return?
Is it the out method parameter or the method that has a return value?
推荐答案
" lianqtlit" < li ******* @ discuss.microsoft.com写信息
news:83 ********************* ************* @ microsof t.com ...
"lianqtlit" <li*******@discussions.microsoft.comwrote in message
news:83**********************************@microsof t.com...
在性能方面,当有一个值时使用成本更高返回
返回?
是out方法参数还是具有返回值的方法?
In performance wise which is more costly to use when there one value to
return?
Is it the out method parameter or the method that has a return value?
我认为的返回值。在大多数语言中,返回值在
寄存器中返回,而参数放在堆栈上。
Return value I presume. In most languages the return value is returned in a
register whereas a parameter is placed on the stack.
>
>
lianqtlit写道:
lianqtlit wrote:
在性能方面,这对于当有一个值返回时使用?
是out方法参数还是具有返回值的方法?
In performance wise which is more costly to use when there one value to return?
Is it the out method parameter or the method that has a return value?
这种差异极不可能对你的整体表现产生任何影响。
专注于可读代码而不是纳秒性能调整。
Arne
It is extremely unlikely that the difference will have any impact on
your overall performance.
Focus on readable code instead of "nanoseconds performance tuning".
Arne
Michael C写道:
Michael C wrote:
" lianqtlit" < li ******* @ discuss.microsoft.com写信息
news:83 ********************* ************* @ microsof t.com ...
"lianqtlit" <li*******@discussions.microsoft.comwrote in message
news:83**********************************@microsof t.com...
>在性能方面,在那里使用成本更高一个值要返回?
是out方法参数还是具有返回值的方法?
>In performance wise which is more costly to use when there one value to
return?
Is it the out method parameter or the method that has a return value?
我认为的返回值。在大多数语言中,返回值在
寄存器中返回,而参数放在堆栈中。
Return value I presume. In most languages the return value is returned in a
register whereas a parameter is placed on the stack.
您是否将其视为更有效或者你认为注册比堆栈慢?
Arne
Did you read it as "more efficient" or do you think register is slower
than stack ?
Arne
这篇关于out返回值的方法和方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!