mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-19 10:01:15 +00:00
Reduce size of Expr
from 80 to 64 bytes (#9900)
## Summary This PR reduces the size of `Expr` from 80 to 64 bytes, by reducing the sizes of... - `ExprCall` from 72 to 56 bytes, by using boxed slices for `Arguments`. - `ExprCompare` from 64 to 48 bytes, by using boxed slices for its various vectors. In testing, the parser gets a bit faster, and the linter benchmarks improve quite a bit.
This commit is contained in:
parent
bd8123c0d8
commit
49fe1b85f2
78 changed files with 326 additions and 258 deletions
|
@ -2588,7 +2588,7 @@ impl AstNode for ast::ExprCompare {
|
|||
|
||||
visitor.visit_expr(left);
|
||||
|
||||
for (op, comparator) in ops.iter().zip(comparators) {
|
||||
for (op, comparator) in ops.iter().zip(&**comparators) {
|
||||
visitor.visit_cmp_op(op);
|
||||
visitor.visit_expr(comparator);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue