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

perf(ast): ThinVec #217

Closed
Boshen opened this issue Mar 27, 2023 · 2 comments
Closed

perf(ast): ThinVec #217

Boshen opened this issue Mar 27, 2023 · 2 comments
Labels
A-ast Area - AST C-investigation Category - it represents an investigation. Further steps may change/add C-label(s) C-performance Category - Solution not expected to change functional behavior, only performance

Comments

@Boshen
Copy link
Member

Boshen commented Mar 27, 2023

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 🤔

@Boshen Boshen changed the title perf(ast): ThinVec perf(ast): ThinVec Mar 27, 2023
@Boshen
Copy link
Member Author

Boshen commented Mar 27, 2023

I really like this benchmark, I need to study how to make this:
rust-lang/rust#104754 (comment)

@Boshen Boshen added C-investigation Category - it represents an investigation. Further steps may change/add C-label(s) A-ast Area - AST C-performance Category - Solution not expected to change functional behavior, only performance labels Mar 29, 2023
@Boshen
Copy link
Member Author

Boshen commented Apr 1, 2023

Closing due to being too complicated for us to implement with bumpalo.

@Boshen Boshen closed this as completed Apr 1, 2023
@Boshen Boshen closed this as not planned Won't fix, can't repro, duplicate, stale Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ast Area - AST C-investigation Category - it represents an investigation. Further steps may change/add C-label(s) C-performance Category - Solution not expected to change functional behavior, only performance
Projects
None yet
Development

No branches or pull requests

1 participant