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

Re: Batch/At (if it wasn't broken, no worries I broke it :-) )

From: "Dmitri Nikulin" <dnikulin@xxxxxxxxx>
Date: Tue, 5 Sep 2006 08:56:27 +1000

On 04 Sep 2006 12:36:28 GMT, Jamie <nospam@xxxxxxxxxxxxx> wrote:
I patched it, removed the macros and replaced them with functions
(to make debugging easier)

As an aside, if you want to preserve the inlinable nature of macros but actually use functions, investigate explicit inlining. It can be a pain because of how many compilers don't support it, but it's in the standard, so it's really their fault.


The bonus is that they can be reduced to normal functions just by
changing compile flags.

It probably isn't necessary in this case, but it can really help
performance if you find yourself calling a small function too often,
or one that can be greatly reduced by inlining variables and so on.
Benchmarks alone will tell you if it helps, but I've found many cases
in which it does.

Note that it still takes much more sophistication to inline recursive
functions, but you can simulate this with an artificial stack anyway,
and overall the performance should be favorable.

Dmitri Nikulin

Centre for Synchrotron Science
Monash University
Victoria 3800, Australia

email: dnikulin@xxxxxxxxx

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