Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduction of the number of heap allocations #109

Closed
m4rs-mt opened this issue May 12, 2020 · 1 comment
Closed

Reduction of the number of heap allocations #109

m4rs-mt opened this issue May 12, 2020 · 1 comment
Assignees
Labels
difficulty:advanced A task that requires advanced knowledge feature A new feature (or feature request)
Milestone

Comments

@m4rs-mt
Copy link
Owner

m4rs-mt commented May 12, 2020

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) and ImmutableArray.Builder instances are created. Especially the ImmutableArray.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.

@m4rs-mt m4rs-mt added feature A new feature (or feature request) difficulty:advanced A task that requires advanced knowledge labels May 12, 2020
@m4rs-mt m4rs-mt added this to the v0.8.1 milestone May 12, 2020
@m4rs-mt m4rs-mt self-assigned this May 12, 2020
@m4rs-mt
Copy link
Owner Author

m4rs-mt commented May 25, 2020

The feature is also related to #118, since Scope and CFG instances perform many allocations during program transformations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty:advanced A task that requires advanced knowledge feature A new feature (or feature request)
Projects
None yet
Development

No branches or pull requests

1 participant