Skip to content

Expr is too big #10100

@kdy1

Description

@kdy1

I found one serious problem of SWC ES AST, which wastes enormous amount of memory / performance.

The problem is that, Expr was needlessly 96 bytes. I optimized it by boxing some large variants, but while refactoring in the past, AssignExpr -> AssignTarget got too big without being caught in a code review.

(Sadly, static assertion was disabled due to a layout size bug of old rustc)
// Memory layout depends on the version of rustc.
// #[cfg(target_pointer_width = "64")]
// assert_eq_size!(Expr, [u8; 80]);

I'll work on this today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions