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: Diane Bruce <db@xxxxxx>
Date: Mon, 4 Sep 2006 20:13:16 -0400

On Tue, Sep 05, 2006 at 08:56:27AM +1000, Dmitri Nikulin wrote:
> 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)
>
. ..
> 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.

It can also blow up a cache line and make your performance worse.
-O3 in gcc can also do that, as it inlines and unrolls loops.

> Benchmarks alone will tell you if it helps, but I've found many cases
> in which it does.

Strive for code readability first and foremost then worry about it,
if something is too slow. Something like this I doubt needs the
optimisation.

> Note that it still takes much more sophistication to inline recursive


I hate macro definitions with a passion. They obsfuscate the code
badly, have too many side effects, are harder to debug.
Use nice normal functions.

--
- db@xxxxxx http://www.db.net/~db



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