Skip to content

Some very basic experiments with using flatbuffers for matrix event serialization

Notifications You must be signed in to change notification settings

matrix-hacks/matrix-flatbuffers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instructions

  • Build/install https://github.com/google/flatbuffers and make sure flatc is in your path.
  • Open flatc-build-cmds.sh in a text editor to understand what it's doing.
  • Run flatc-build-cmds.sh.
  • Observe the results in the Matrix directory.
  • This will contain a .bin file with the binary flatbuffer itself as well as language-specific bindings for reading that data.

Files

member.fbs

Flatbuffer schema file. Describes the layout of the binary format.

m.room.member_example.json

An example matrix event pulled from here: https://github.com/matrix-org/matrix-doc/blob/master/event-schemas/examples/m.room.member%23invite_room_state

flatc-build-cmds.sh

Script that uses flatc to generate a binary flatbuffer from the json file, and generate language bindings for reading back the binary format.

What's the point of this?

If homeservers and clients were capable of supporting flatbuffers, clients and homeservers would not have to parse json anymore. Performance wise, that's pretty nice. Benchmarks here: https://google.github.io/flatbuffers/flatbuffers_benchmarks.html It's perhaps worth consideration.

About

Some very basic experiments with using flatbuffers for matrix event serialization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages