Reduction of the number of heap allocations #109
Labels
difficulty:advanced
A task that requires advanced knowledge
feature
A new feature (or feature request)
Milestone
Like all compilers, ILGPU performs a variety of memory allocations during its transformations and IR construction phases. Each node carries additional information about child nodes, its type, its uses (etc.). Since every IR node in the ILGPU world is considered immutable after construction (e.g. to allow multi-threaded processing), many
ImmutableArray
(their undalying array instances) andImmutableArray.Builder
instances are created. Especially theImmutableArray.Builder
instances are extremely short-living and are used in many places. These instances are usually collected in the first generation of a GC run. However, performing many heap allocations increases the runtime and the total pressure on the GC. In addition, a builder instance is allocated on the heap and contains a pointer to a list-like array instance. These indirections can also cause unnecessary performance degradation.A new inline list structure (in combination with specially designed read-only views), optimized for these use cases, can significantly reduce the number of required heap allocations and improve overall compiler performance.
The text was updated successfully, but these errors were encountered: