near / borsh-rs

Rust implementation of Binary Object Representation Serializer for Hashing
https://borsh.io/
Apache License 2.0
310 stars 67 forks source link

[experiment] chore: add `<T as BorshSerialize>::ALLOCATION_HINT` field #243

Closed dj8yfo closed 1 year ago

dj8yfo commented 1 year ago

pr is not for merge, just to illustrate a microoptimization

may make sense to override initial vector allocation capacity per type, but that can be done with introducing a constant on BorshSerialize trait

from comment