Threading libsmbclient - a proposal.

Derrell Lipman derrell.lipman at unwireduniverse.com
Sat Apr 4 12:21:56 GMT 2009


On Sat, Apr 4, 2009 at 4:16 AM, Volker Lendecke
<Volker.Lendecke at sernet.de>wrote:

> On Fri, Apr 03, 2009 at 12:51:05PM -0400, Derrell Lipman wrote:
> > And we probably want to avoid even that, particularly in areas of code
> that
> > are executed frequently. Function calls can be expensive. It's probably
> much
> > more efficient to say "if (func_ptr != NULL) (*func_ptr)(params);" than
> to
> > call a dummy function via func_ptr. That could all be hidden behind a
> macro,
> > though, so the code isn't cluttered by it.
>
> Are function calls really expensive these days? With all the
> levels of caches these days and just silly fast CPUs, isn't
> it more important to be cache friendly? When I added the
> "unlikely" to the DEBUG macros, it actually made a
> difference when looking at our cache footprint with
> cachegrind. And that made a few percent difference for
> netbench.
>

You may be right. I'm old. :-) Some habits instilled early in my career may
no longer be so necessary and I haven't researched it recently.

Derrell


More information about the samba-technical mailing list