Some great advice in this thread!
I agree here I need to start optimizing slow parts of the app where performance has business value.
We have a service that runs entirely in memory (except writing to an event log) and it runs very quickly. I’m sold on the approach
I think you’re saying yourself, but it feels like Plan A should be to try to make things run as fast as possible before resorting to NIFs because NIFs add complexity and you lose some advantages of the BEAM.
For the next thing I need to optimize, i will do just this. I am honestly looking for general advice at this point because performance is an area of more interest to me now.
It feels like as I am improving this skill, I should first focus on becoming better at diagnosing pref bottlenecks rather before getting too involved in solutions to improve performance. Optimizing seems like two skills - identifying what is slow, then a good mental model of knowing what changes are likely to speed up a particular chunk of code.
I will try to be patient here!
You will be happy to hear that I have been doing this recently. I was inspired by a talk on YouTube called “Moving IO to the edges of your app”. I think patterns like Ecto.Multi
are intended to encourage this pattern right?