h****e 发帖数: 2125 | 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? | c********e 发帖数: 383 | 2 hahahaha,你们两个,等芒果这一阵子吧,到时候要是我来了,就张嘴要钱
呵呵 | h****e 发帖数: 2125 | 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,你们两个,等芒果这一阵子吧,到时候要是我来了,就张嘴要钱 : 呵呵
| X****r 发帖数: 3557 | 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
| h****e 发帖数: 2125 | 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
| X****r 发帖数: 3557 | 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...
| h****e 发帖数: 2125 | 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,你们两个,等芒果这一阵子吧,到时候要是我来了,就张嘴要钱 : 呵呵
| h****e 发帖数: 2125 | 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
| h****e 发帖数: 2125 | 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
|
|