Avoid reallocating a new array when reading it in my CustomProcedure
#665
-
Hi, I'm trying to avoid reallocating a new array for each time I am reading it in my Copy code
while ((key = GetNextArg(input, ref offset)).Length > 0) {
if (garnetApi.GET(ref key, ref ArgSlice array) == GarnetStatus.OK) {
// Process the array
}
} From my understanding, the call I believe that to avoid array reallocation, I should use this method in MainStoreOps.cs.
Any guidance would be greatly appreciated! Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
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.
Please check out the new APIs as part of this PR #700 that help with buffer management like in your case.