In order to be able to set an array of values and do that efficiently we added SetBytesOptionsManyByGetResult() so that all of the values are set at once instead of having to go through the JSON for each value separately. It inserts each value at a specified index maintaining the diff between the original and inserted value, so that the next time the insert happens, the index of the original value will be moved in accordance with the diff.
The other improvement, if you already searched the JSON and have the result of gjson.Get(), then you can just pass it to sjson.Set() instead of having to fire another search inside.
In order to be able to set an array of values and do that efficiently we added SetBytesOptionsManyByGetResult() so that all of the values are set at once instead of having to go through the JSON for each value separately. It inserts each value at a specified index maintaining the diff between the original and inserted value, so that the next time the insert happens, the index of the original value will be moved in accordance with the diff.
The other improvement, if you already searched the JSON and have the result of gjson.Get(), then you can just pass it to sjson.Set() instead of having to fire another search inside.
57