Skip to content
  • Philippe Gerum's avatar
    alchemy: inline scalar->timespec conversion in caller context · 654435fd
    Philippe Gerum authored
    Unconditional ticks/nanoseconds to timespec conversions via a common
    helper routine can be costly on low end hardware, putting some useless
    pressure on the I-cache when the operation just substitutes an input
    constant by another.
    
    Typically, most often the caller passes an infinite wait specification
    to blocking Alchemy services, which is translated to NULL for the
    copperplate API to start an unbounded wait, so going through a
    conversion call to map TM_INFINITE to NULL is pure overhead. In that
    case, we would be better off doing the substitution directly from the
    calling context.
    
    To thos end, this patch introduces a *_timed() call form for each
    blocking Alchemy service, which receives a timespec directly. All
    existing relative and absolute call forms of blocking services now
    convert the timeout value inline when possible, before branching to
    the *_timed() call.
    654435fd