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
For applications that constantly marshal/unmarshal bitsets, this is a huge problem. What ReadFrom should do instead is try to reuse the existing bitset and the underlying []uint64 it has. It should avoid creating any one-time temporary heap buffers as well.
To be honest I don't know why it works like that but the fact that ReadFrom does not modify the existing instance if it encounters an error makes this a little tricky.
The text was updated successfully, but these errors were encountered:
ReadFrom
creates a newbitset
and overrides the previous one when it does not encounter any error during the process.bitset/bitset.go
Lines 949 to 968 in d53c44e
For applications that constantly marshal/unmarshal
bitset
s, this is a huge problem. WhatReadFrom
should do instead is try to reuse the existingbitset
and the underlying[]uint64
it has. It should avoid creating any one-time temporary heap buffers as well.To be honest I don't know why it works like that but the fact that
ReadFrom
does not modify the existing instance if it encounters an error makes this a little tricky.The text was updated successfully, but these errors were encountered: