Skip to content

perf(ast): ThinVec #217

Closed as not planned
Closed as not planned
@Boshen

Description

@Boshen

From https://nnethercote.github.io/2023/03/24/how-to-speed-up-the-rust-compiler-in-march-2023.html

#104754: In this PR I changed a lot of Vec occurrences in AST nodes to ThinVec, which stores the length and capacity of non-empty vectors on the heap next to the vector’s elements. This means that the size of a ThinVec struct is just one word, compared to three words for Vec. This makes it a good choice for vectors that are often empty, and it can also be used to shrink the largest variants of an enum, if those variants contains a Vec. This change reduced the size of many AST nodes

I wonder how hard it is to crate our own ThinkVec based on bumpalo 🤔

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-astArea - ASTC-investigationCategory - it represents an investigation. Further steps may change/add C-label(s)C-performanceCategory - Solution not expected to change functional behavior, only performance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions