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

Expr is too big #10100

Open
kdy1 opened this issue Feb 25, 2025 · 0 comments
Open

Expr is too big #10100

kdy1 opened this issue Feb 25, 2025 · 0 comments
Assignees
Milestone

Comments

@kdy1
Copy link
Member

kdy1 commented Feb 25, 2025

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.

@kdy1 kdy1 added this to the Planned milestone Feb 25, 2025
@kdy1 kdy1 self-assigned this Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant