From owner-freebsd-current Mon Jul 12 23:27:11 1999 Delivered-To: freebsd-current@freebsd.org Received: from ducky.net (gate.ducky.net [199.2.211.252]) by hub.freebsd.org (Postfix) with ESMTP id 5CF4114BD0 for ; Mon, 12 Jul 1999 23:27:07 -0700 (PDT) (envelope-from mike@ducky.net) Received: from ducky.net (localhost.ducky.net [127.0.0.1]) by ducky.net (8.9.1/8.8.5) with ESMTP id XAA18672; Mon, 12 Jul 1999 23:09:20 -0700 (PDT) Message-Id: <199907130609.XAA18672@ducky.net> To: Mike Smith Cc: Mike Haertel , Matthew Dillon , Luoqi Chen , 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") In-reply-to: Your message of "Mon, 12 Jul 1999 19:09:58 PDT." <199907130209.TAA03301@dingo.cdrom.com> Date: Mon, 12 Jul 1999 23:09:19 -0700 From: Mike Haertel Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >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