avatar
inline functions in C++# Programming - 葵花宝典
h*e
1
said it's more efficient to put often-used and short functions as inline, so
they are taken care of at compile time, to save function calls overhead and
improve performance thereafter. this I understand, but how do u define "short
functions"?? dozens of lines or a
few hundred lines? or some big functions, I can divide them into smaller
funcs and make them inline?? besides, what bad impact if I make some large
funcs inline?
avatar
c*e
2
hahahaha,你们两个,等芒果这一阵子吧,到时候要是我来了,就张嘴要钱
呵呵
avatar
h*e
3
1. do customers care about compile time?
2. i am working on a server with 32G RAM, size doesn't matter.
3. large functions won't be used very often, otherwise they should be
divided into smaller pieces...

mutator
could
time

【在 c********e 的大作中提到】
: hahahaha,你们两个,等芒果这一阵子吧,到时候要是我来了,就张嘴要钱
: 呵呵

avatar
X*r
4
If there are some common parts within many functions, why didn't make them
a separate function in the first place?

funcs

【在 h****e 的大作中提到】
: 1. do customers care about compile time?
: 2. i am working on a server with 32G RAM, size doesn't matter.
: 3. large functions won't be used very often, otherwise they should be
: divided into smaller pieces...
:
: mutator
: could
: time

avatar
h*e
5
similarly, many things can be made a function. for example,
a large func goes through a small block A, and another small block b is used
by some other funcs. a and b share about 60% logic, r u gonna make a function
including both case a and b or not? u know, even totally different logic can
be in one function as well, just use a if/switch branch...

【在 X****r 的大作中提到】
: If there are some common parts within many functions, why didn't make them
: a separate function in the first place?
:
: funcs

avatar
X*r
6
If there are some common parts within many functions, why didn't make them
a separate function in the first place?

funcs

【在 h****e 的大作中提到】
: similarly, many things can be made a function. for example,
: a large func goes through a small block A, and another small block b is used
: by some other funcs. a and b share about 60% logic, r u gonna make a function
: including both case a and b or not? u know, even totally different logic can
: be in one function as well, just use a if/switch branch...

avatar
h*e
7
1. do customers care about compile time?
2. i am working on a server with 32G RAM, size doesn't matter.
3. large functions won't be used very often, otherwise they should be
divided into smaller pieces...

mutator
could
time

【在 c********e 的大作中提到】
: hahahaha,你们两个,等芒果这一阵子吧,到时候要是我来了,就张嘴要钱
: 呵呵

avatar
h*e
8
similarly, many things can be made a function. for example,
a large func goes through a small block A, and another small block b is used
by some other funcs. a and b share about 60% logic, r u gonna make a function
including both case a and b or not? u know, even totally different logic can
be in one function as well, just use a if/switch branch...

【在 X****r 的大作中提到】
: If there are some common parts within many functions, why didn't make them
: a separate function in the first place?
:
: funcs

avatar
h*e
9

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~faint, I mean some common parts within all funcs
of course.
case,

【在 X****r 的大作中提到】
: If there are some common parts within many functions, why didn't make them
: a separate function in the first place?
:
: funcs

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。