perf(transformer/object_rest_spread): use ArenaVec to store values that will be used in constructing AST#10434
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
7b04309 to
d09d8be
Compare
CodSpeed Instrumentation Performance ReportMerging #10434 will not alter performanceComparing Summary
|
d09d8be to
ccdd6e9
Compare
2351230 to
f431eec
Compare
07fcd0b to
d9f2655
Compare
Merge activity
|
d9f2655 to
b645ac3
Compare
f431eec to
1457e68
Compare
|
There's something cool we could do here with our new We could add an API let original_len = vec.len();
let original_ptr = vec.as_ptr();
let (vec1, vec2) = vec.split_at(2).unwrap();
assert!(vec1.len() == 2);
assert!(vec2.len() == original_len - 2);
// `vec1` and `vec2` point to chunks of the original `vec`
assert!(vec1.as_ptr() == original_ptr);
assert!(vec2.as_ptr() == original_ptr.add(2));
Using |
b645ac3 to
1f77cac
Compare
…that will be used in constructing AST (#10434) `props` is always used in `expression_object` without intermediate changes, so it is okay and good to use `ArenaVec` store, which also can avoid an unnecessary allocation (std vec -> arena vec converison).
1f77cac to
595c5df
Compare
That's cool! Maybe a dumb question, what scenario do you want to use this API for? In terms of the PR changes, we don't need to use let original_vec = vec![1, 2, 3, 4, 5];
let cut_vec = vec.cut_off(2).unwrap();
assert!(original_vec.len() == 2);
assert!(cut_vec.len() == 3);
assert!(cut_vec.as_ptr() == original_vec.as_ptr().add(2)); |
|
Yes, you're right. All we need is to optimize |

propsis always used inexpression_objectwithout intermediate changes, so it is okay and good to useArenaVecstore, which also can avoid an unnecessary allocation (std vec -> arena vec converison).