mautrix/go

Code gen go/event/ content

gedw99 opened this issue · 1 comments

It uses reflection which slows things down at runtime.

Looks like we could consider Code generating it .

it will also open up possibilities of building wasm based gui with tinygo if that’s your cup of tea.. tinygo does not support reflection because it’s a non garbage collection compiler I believe but could be wrong

I was wrong :)
https://tinygo.org/docs/reference/lang-support/ Says it does garbage collection

We can also replace the json encoder with a non reflection json package

there are 2 drop in one that work well with no code changes. No need for code gen .
it will speed things up and has much less garbage collection