Open markschl opened 7 months ago
I will look making this part of the library more efficient. There are definitely some improvements that can be made on this front!
Minor note though, Args::new_usized()
doesn't allocate, it does create a vector but rust vectors don't allocate until they are required to.
Many thanks, and you are right, I was not being precise about empty vectors.
While trying to repeadedly call a function with arguments of (initially) unknown number, I noticed that I had to re-construct the
Args
before everyFunction::call_arg
orArgs::apply
(in v0.4 beta). This seems quite inefficient, sinceArgs::new_unsized()
allocates a vector, and theArgs
is then consumed during the function call.Is there any other efficient way that I missed? Is there a specific reason that
IntoArgs
cannot be implemented for&[Value]
, such that e.g. an instance ofVec<Value>
or evenPersistent<Vec<Value>>
could be kept around and reused?