DragonFly BSD
DragonFly kernel List (threaded) for 2006-06
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: warning about 'large-function-growth limit reached'


From: "Dmitri Nikulin" <dnikulin@xxxxxxxxx>
Date: Fri, 16 Jun 2006 00:54:27 +1000

On 6/16/06, Richard Tobin <richard@xxxxxxxxxxxx> wrote:
> Either way inlining is overrated unless the function is
> both extremely small and frequently used, and yet still too messy to
> make a macro.

That depends on how you measure "small".  A function consisting of
a hundred-case switch, with most of the cases very small (e.g. a
virtual machine) might well be worth inlining.

Good point! I should have specified as "short effective length for any call". The question then is, what will gcc do? If the call is constant it could remove all but one case, but otherwise it will end up just folding the whole switch in, which will almost certainly cross its inlining threshold. I've been able to cross the default threshold of gcc 3.3 with barely 30 lines of effective code (some of it folded into one-liners so the actual was smaller). That's nowhere near a hundred cases of VM operations. Out of curiosity, is ANY VM instruction set as expansive as 100 opcodes?

-- Dmitri Nikulin



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]