:
:> Although function calls are more expensive than inline code,
:> they aren't necessarily a lot more so, and function calls to
:> non-locked RMW operations are certainly much cheaper than
:> inline locked RMW operations.
:
: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?

    In terms of cycles, either less or the same.  Certainly not more.
    If you think about it, a function call is nothing more then a save, a jump,
    and a retrieval and jump later on.  On intel the save is a push, on other
    cpu's the save may be to a register (which is pushed later if necessary).

    The change in code flow used to be the expensive piece, but not any
    more.  You typically either see a branch prediction cache (Intel)
    offering a best-case of 0-cycle latency, or a single-cycle latency 
    that is slot-fillable (MIPS).

    Since the jump portion of a subroutine call to a direct label is nothing
    more then a deterministic branch, the branch prediction cache actually
    operates in this case.  You do not quite get 0-cycle latency due to
    the push/pop, and potential arguments, but it is very fast.

                                        -Matt
                                        Matthew Dillon 
                                        <[EMAIL PROTECTED]>


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to