Home

readytorun

ReadyToRun is a feature of the .NET runtime that provides ahead-of-time (AOT) compilation for managed assemblies. It creates ReadyToRun images by precompiling a subset of IL code into native code and embedding it alongside assemblies. The goal is to accelerate startup and reduce the workload on the Just-In-Time (JIT) compiler during application startup.

Origins and tooling: ReadyToRun originated in the .NET Core ecosystem as a mechanism to improve startup performance.

Usage and configuration: ReadyToRun images are generated at publish time for selected assemblies, and developers can

Impact and limitations: The primary benefit is reduced startup latency and faster initial JIT warm-up by using

Relation to other technologies: ReadyToRun is distinct from Native AOT, which compiles an application to a

It
is
produced
using
the
crossgen
tool,
and
in
newer
runtimes
it
has
been
extended
with
crossgen2.
The
precompiled
native
code
is
platform-
and
runtime-specific.
At
startup,
the
runtime
will
use
the
precompiled
image
when
it
is
compatible;
if
not,
it
falls
back
to
JIT
compilation
for
the
relevant
code
paths.
configure
which
parts
of
an
application
are
precompiled.
The
feature
is
controlled
by
publish
or
project
settings
and
depends
on
the
target
runtime
identifier
(RID).
Images
may
need
regeneration
after
framework
updates
or
changes
to
the
application
or
its
dependencies
to
remain
valid.
precompiled
code
paths.
Trade-offs
include
increased
package
size
and
potential
compatibility
concerns
with
certain
dynamic
code
patterns
or
framework
updates.
Not
all
code
is
necessarily
precompiled,
and
some
scenarios
such
as
heavy
use
of
reflection
may
benefit
less
or
require
careful
configuration.
fully
standalone
native
binary.
ReadyToRun
serves
as
an
optimization
within
the
runtime,
precompiling
critical
paths
to
improve
startup
without
replacing
the
broader
JIT
and
runtime
model.