Skip to content

semantic: large memory allocation for AstNodes #183

@Boshen

Description

@Boshen

In enormous files bundled by rolldown, AstNodes allocates GBs of memory

Image

https://github.com/oxc-project/oxc/blob/0816ef43092e92001e3c90439d4d97278f201c63/crates/oxc_semantic/src/node.rs#L100-L110

https://github.com/oxc-project/oxc/blob/0816ef43092e92001e3c90439d4d97278f201c63/crates/oxc_semantic/src/node.rs#L15-L29

Short term solution

Feature gate some of the fields.

Long term solution

Switch the nodes to a stack - we do not need to store all the nodes in the rolldown pipeline, its only needed by the linter pipeline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-semanticArea - Semantic Analysis

    Type

    No type

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions