You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On v1, I was seeing alot of allocation due to string copying. So I added 2 small upgrades:
a) BenchmarkUnmarshalCapnpZeroCopyNoAlloc() in mem.go
b) Bytes() and TextList.AtBytes() methods that return the []byte slice directly instead of copying it to a string.
The reduction in memory allocation means that I can then read a ton of mmap-ed data and analyze the string fields, all while doing zero-allocation and having zero GC pressure.
On v1, I was seeing alot of allocation due to string copying. So I added 2 small upgrades:
a) BenchmarkUnmarshalCapnpZeroCopyNoAlloc() in mem.go
b) Bytes() and TextList.AtBytes() methods that return the []byte slice directly instead of copying it to a string.
The reduction in memory allocation means that I can then read a ton of mmap-ed data and analyze the string fields, all while doing zero-allocation and having zero GC pressure.
See glycerine/go-capnproto@db36ab2
comparisons:
and
It would be great to add similar API []byte access to v2.
The text was updated successfully, but these errors were encountered: