Skip to content

Commit 291905b

Browse files
Jeremy Braunfacebook-github-bot
Jeremy Braun
authored andcommitted
avoid tuple allocations in cmd_args.add()
Summary: We call `cmd_args.add()` a LOT. Using an `UnpackTuple` forces `starlark` to allocate a tuple on the heap every time it's called. By processing the arguments ourselves we avoid the `heap.alloc_tuple`, and reduce the overall allocations occuring on starlark `Heap`s Reviewed By: JakobDegen Differential Revision: D69211163 fbshipit-source-id: 3a10ec66e1ed8ef3fbed69628a986fb0f4be59ba
1 parent 36f83c1 commit 291905b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

starlark/src/eval/runtime/arguments.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ impl<'v, 'a> Arguments<'v, 'a> {
346346
}
347347

348348
/// Unpack all positional parameters into an iterator.
349-
pub(crate) fn positions<'b>(
349+
pub fn positions<'b>(
350350
&'b self,
351351
heap: &'v Heap,
352352
) -> crate::Result<impl Iterator<Item = Value<'v>> + 'b> {

0 commit comments

Comments
 (0)