New programmer seeking resources for learning about performance in Elixir/Ecto/Phoenix

First of all, this community has helped me grow as a programmer. For that I am forever grateful. You all are the only reason I have a career to begin with.

To my question, I’ve never done any kind of performance testing - load testing, benchmarking. To be honest, I’m not sure how to even go about this / the differences.

The Pragmatic Programmer books have been my favorite to read so far but don’t see anything on this topic. Is there a resource similar that you all recommend? Assume little to know knowledge of how performance works.

Thank you!

1 Like

I found Elixir School quite helpful, although web development section seems to be missing. But the community is super welcoming and you can learn by contributing (this is what I am currently doing)

For Phoenix basics I liked this course which is currently under development and free. The teachers (which seem to be such nice people) are also offering a general Elixir course which I’ll probably check out in the future as well

You can start with Benchee. The way it works is that you can compare 2 or more competing implementations of the same thing.

I agree that having a good performance culture helps being a better programmer – but please do make sure that you’re not getting pressured on your workplace into doing work that’s not immediately beneficial. Or somebody is looking for an excuse to give you a hard time.

I work with Elixir for almost 4 years now and I’ve only seen one project where actual benchmarking and fine performance tuning were important.

2 Likes

My biggest worry is performance with Ecto queries in particular. Any suggestions there?

You won’t like this but you’ll have to get very much into query planning and analysis.

Simply prepending EXPLAIN ... in front of any SQL query will give you a good insight what is your DB’s query planner doing. Often if gives people hints on DB indexes that can help accelerate queries, for example. But it can also give you an idea that you need to break apart a big query on a subquery (or a CTE) which you then merge / select on.

There’s a lot to learn in terms of SQL query optimization. I honestly stopped long ago. It can be hugely beneficial but the biggest worry in most software projects is programmer velocity. Query optimization is only done if something is obviously slow. Then you can get your hands dirty, and not before – that’s the approach I prefer.

3 Likes