Home

percall

Percall, in performance engineering, refers to the time or resources required to perform a single invocation of a function or subroutine, excluding the actual work done by the function body. It is a measure of per-call overhead and is used to understand the fixed cost associated with calling a function, regardless of input size.

Per-call overhead arises from several components of the calling process. These include the calling convention and

The magnitude of per-call overhead varies with language, compiler optimizations, inlining decisions, and hardware. In statically

Optimization often targets reducing per-call overhead, with caveats. Inlining eliminates call overhead at the expense of

See also: function call overhead, inlining, calling convention, tail call optimization, microbenchmarking.

instruction
sequence
that
transfer
control,
the
setup
and
teardown
of
the
stack
frame,
the
passing
of
arguments,
and
the
return
mechanism.
In
addition,
dynamic
dispatch
(such
as
virtual
method
calls),
exception
handling
setup,
and
any
instrumentation
or
tracing
added
by
runtimes
can
contribute
to
per-call
cost.
On
multi-threaded
or
interrupt-driven
systems,
context
switches
and
scheduler
overhead
can
also
influence
per-call
measurements.
compiled
languages
with
aggressive
inlining,
per-call
cost
can
be
very
small,
while
in
interpreted
or
JIT-compiled
environments,
or
when
virtual
dispatch
is
used,
it
can
be
substantially
higher.
Measurements
are
typically
expressed
as
time
or
CPU
cycles
per
call
(for
example
nanoseconds
per
call
or
cycles
per
call)
in
microbenchmarks.
Results
can
be
sensitive
to
measurement
methodology,
warm-up,
inlining
status,
and
cache
effects.
larger
code
size,
which
may
affect
instruction
cache
performance.
Replacing
virtual
calls
with
direct
calls,
avoiding
unnecessary
instrumentation,
or
batching
work
to
reduce
the
number
of
calls
can
improve
throughput
but
may
change
modularity
and
readability.
Per-call
optimization
should
be
balanced
against
overall
design
and
maintainability.