Avoid reallocating a new array when reading it in my CustomProcedure
#665
Unanswered
danielvan1
asked this question in
Q&A
Replies: 1 comment
-
Hi Thanks for trying this feature. Using the GET api that takes in the ArgSlice argument is the recommended way to perform GET operations from a custom procedure/transaction as shown in the Sum.cs example. The allocation is required to ensure the input buffer is setup in the right way for the backend processing. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm trying to avoid reallocating a new array for each time I am reading it in my
CustomProcedure
. I'm working with a loop similar to the one in Sum.cs:From my understanding, the call
garnetApi.GET(ref key, ref ArgSlice array)
allocates a new array each time it's invoked. This interpretation comes from looking at the method in MainStoreOps.cs.I believe that to avoid array reallocation, I should use this method in MainStoreOps.cs.
SpanByte input
parameter in this method.SpanByte input
andSpanByteAndMemory output
in the method of theCustomProcedure
Any guidance would be greatly appreciated!
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions