Two things I'm concluding by implementing memory profiling in my backend for @streambits :

1. JSON encoding is hella expensive, several times more than calling load funcs in Streambits Core.
2. go-reflectx is the devil and I need to kill off my usage of gocqlx.

@streambits Out of 16.36kB for a gocqlx Select call, 12.35kB (75.4%) was just go-reflectx. In comparison, the rest of my load funcs in various parts of the stack range from 4.12kB and 8.24kB.

For one of my API handlers, 27.62kB was just json Encode, out of 39.88kB. I performed two calls of my load funcs for the rest of that.

Show thread

@streambits Oh and as much as I love gorilla mux for HTTP routing / multiplexing, 38.34kB of memory for it is being spent on its use of regexp alone. That is 23.50% out of the 65.81% being allocated for mux router ServeHTTP for a served http *conn. That's no good.

Sign in to participate in the conversation

Everyone is welcome as long as you follow our code of conduct! Thank you. is maintained by Sujitech, LLC.