Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jul 1999 23:09:19 -0700
From:      Mike Haertel <mike@ducky.net>
To:        Mike Smith <mike@smith.net.au>
Cc:        Mike Haertel <mike@ducky.net>, Matthew Dillon <dillon@apollo.backplane.com>, Luoqi Chen <luoqi@watermarkgroup.com>, dfr@nlsystems.com, jeremyp@gsmx07.alcatel.com.au, freebsd-current@FreeBSD.ORG, mike@ducky.net
Subject:   Re: "objtrm" problem probably found (was Re: Stuck in "objtrm") 
Message-ID:  <199907130609.XAA18672@ducky.net>
In-Reply-To: Your message of "Mon, 12 Jul 1999 19:09:58 PDT." <199907130209.TAA03301@dingo.cdrom.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
>This is a fairly key statement in context, and an opinion here would 
>count for a lot; are function calls likely to become more or less 
>expensive in time?

Ambiguous question.

First answer: Assume we're hitting the cache, taking no branch
mispredicts, and everything is generally going at "the speed of
light".  The cost of a call, relative to the cost of "basic
operations" like loads and adds, will stay about the same in Intel's
next-generation x86 processors as it is now.  We made some tradeoffs,
some things go a little faster and others a little slower, but in
the end the function call overhead averages out to about the same.

Second answer: in the real world, we're nearly always hitting the
cache on stack operations associated with calls and argument passing,
but not less often on operations in the procedure body.  So, in
the real world, as memory latencies get worse and worse relative
to processor frequency, the overhead for procedure calling represents
an increasingly smaller percentage of the total execution time.

Summary: So, correctly predicted calls are staying the same or
getting cheaper.  Certainly calls are not getting worse, unless
perhaps you have lots of mispredicted calls.  As pipelines get
deeper, mispredicts get worse.  But that's not a problem just for
calls, it's branches in general.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199907130609.XAA18672>