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

refactor(ast): make AST structs repr(C). #4614

Merged
merged 1 commit into from
Aug 3, 2024

Commits on Aug 3, 2024

  1. refactor(ast): make AST structs repr(C). (#4614)

    Make structs `#[repr(C)]` without reordering them to benchmark the performance implications of it.
    
    This PR adds 136 bytes of padding in total. You can visit the list of these types [here](https://github.com/oxc-project/oxc/pull/4404/files/)(checkout the `assert_layouts.rs` diff).
    
    Update:
    
    Doesn't seem too bad!
    
    ![image](https://github.com/user-attachments/assets/05ac9cc8-7cb0-4ed5-9220-44f65c7f5bb9)
    
    * Linter: We can easily get more than 1% performance gain in the linter to even things out
    * Prepass: If we fix our issue with Rust `1.80.0` we gain 13% And it should also be possible to find some other areas there to gain back this one percent.
    
    The most notable thing is that `parser` isn't impacted by this, That is our most optimized crate which every percent counts(and it can be hard to gain back any perf regression there).
    rzvxa committed Aug 3, 2024
    Configuration menu
    Copy the full SHA
    3f53b6f View commit details
    Browse the repository at this point in the history