project-machine / puzzlefs

A next-generation container filesystem
Apache License 2.0
393 stars 17 forks source link

implement the "real" wire format #18

Closed tych0 closed 1 year ago

tych0 commented 3 years ago

Right now we're using serde_cbor to serialize things, and e.g. in structures it puts essentially a json map with a string of the field name in. That's useful to get us off the ground, but we should implement a real serialization for our objects so we get smaller representations of them.

tych0 commented 3 years ago

related: right now MetadatBlob::find_inode parses the entire inode list, and then does a subsequent on-disk binary search to find the real inode. That sucks and this would fix it :)

ariel-miculas commented 1 year ago

possible alternative: https://github.com/bincode-org/bincode

ariel-miculas commented 1 year ago

The find_inode no longer reads the entire inode list into memory as of https://github.com/anuvu/puzzlefs/pull/49

ariel-miculas commented 1 year ago

Hey @tych0, did you have any alternatives to cbor in mind for the puzzlefs wire format?

tych0 commented 1 year ago

Not really. Maybe something completely custom is best in terms of filesystem size, but also annoying to implement. Protobuf? Capnproto? There isn't really precedent for any standard binary format in the kernel that I'm aware of, unfortunately.

ariel-miculas commented 1 year ago

capnproto was also mentioned by Kent Overstreet here

tych0 commented 1 year ago

My understanding is that capnproto has pretty good encoding/decoding optimizations over e.g. protobuf, so it seems like a reasonable suggestion.