stackitem: reusable serialization context
We serialize items a lot and this allows to avoid a number of allocations.
This commit is contained in:
parent
3d4076ca36
commit
c3d989ebda
13 changed files with 111 additions and 42 deletions
|
@ -364,13 +364,14 @@ func (o *Oracle) RequestInternal(ic *interop.Context, url string, filter *string
|
|||
return err
|
||||
}
|
||||
|
||||
data, err := stackitem.Serialize(userData)
|
||||
data, err := ic.DAO.GetItemCtx().Serialize(userData, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(data) > maxUserDataLength {
|
||||
return ErrBigArgument
|
||||
}
|
||||
data = slice.Copy(data) // Serialization context will be used in PutRequestInternal again.
|
||||
|
||||
var filterNotif stackitem.Item
|
||||
if filter != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue