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
Bincode has serialize_into which supports an arbitrary Writer, this would be very useful for RON as well, especially with BufWriter, because the data gets very large.
I'm seeing huge RAM spikes because of RON serialization: From ~90 MB baseline RAM usage to over 700 MB when it's serializing. Btw, the resulting ron file is 20 MB large.
In the above application, I'm serializing app state to disk every 10s.
Btw, the CPU usage is also quite high. This is the CPU & RAM usage when serializing to bincode instead. With ROM, the CPU usage is almost always at ~27% (probably because it takes so long), with bincode, it only shows short spikes (to 24%) when serializing:
Anyway, with a function like serialize_into+BufWriter we could at least reduce the RAM spikes.
This would also allow chaining it with e.g. a Gzip encoder for streaming compression, e.g. like with bincode:
206: feat: port `ser::Serializer` to `io::Write` r=kvark a=Plecra
Makes the `Serializer` struct generic over `io::Write`, allowing it to be used with more types (and less allocation). As a side-effect, the trailing commas are also removed from the output.
This was a quick implementation, written in response to compiler messages, so it could probably do with some cleaning up. It might be a good time to approach #175Closes#202
## TODO
- [ ] Update docs
Co-authored-by: Marli Frost <marli@frost.red>
Bincode has
serialize_into
which supports an arbitrary Writer, this would be very useful for RON as well, especially withBufWriter
, because the data gets very large.I'm seeing huge RAM spikes because of RON serialization: From ~90 MB baseline RAM usage to over 700 MB when it's serializing. Btw, the resulting ron file is 20 MB large.
In the above application, I'm serializing app state to disk every 10s.
Btw, the CPU usage is also quite high. This is the CPU & RAM usage when serializing to bincode instead. With ROM, the CPU usage is almost always at ~27% (probably because it takes so long), with bincode, it only shows short spikes (to 24%) when serializing:
Anyway, with a function like
serialize_into
+BufWriter
we could at least reduce the RAM spikes.This would also allow chaining it with e.g. a Gzip encoder for streaming compression, e.g. like with bincode:
The text was updated successfully, but these errors were encountered: