FChannel0 / FChannel-Server

GNU Affero General Public License v3.0
106 stars 14 forks source link

Optimize structs #74

Closed ghost closed 7 months ago

ghost commented 2 years ago

This shaves off a lot of unneeded data in JSON output, mostly to do with attachment and preview. It is still not completely ideal, and could very well be unstable due to changing some struct fields to pointers. Also largely untested in federation, however preliminary testing between feditext and fchannel seems to work fine.

I plan to do some more extensive testing soon, specifically between v0.0.16 and v0.1.1. This will remain a draft until then.

FChannel0 commented 2 years ago

this is much needed. i originally had a lot of structs with pointers but got tired of the null pointer exceptions and removed all the pointers whereever i could. but that makes the json carry a lot of unnecessary fields. good stuff, appreciate the improvements

ghost commented 2 years ago

Apologies for the delay, got busy with other much more important things right around the time I would've really tested this. It seems to work fine in a network of 3 nodes, two with my changes and one running master. Should be ready to merge.