shishini
I think this twitter post and youtube video didn’t get as much attention as I hoped
I am still new to Elixir, so can’t really judge
https://x.com/antonvputra/status/1865845828192977341
Its generally understandable that a compile statically typed language like go will be faster than Elixir (being dynamic and running on a vm) but I a bit surprised the availability performance
Trending in Discussions
In my third year of college, around 2010, I found Erlang. A few years later, I found Elixir. I liked the ideas at once: many small proces...
New
This is the start of my Elixir learning journal/journey. I plan to share my journey in this thread and am open to all feedback, construct...
New
This is where the projects in the Hologram Showcase get posted: apps built with Hologram and libraries made for it. New ones go up usuall...
New
Never used it. I know it’s well-liked by some and the authors have put a lot of work into it.
Aside from that, is there a community cons...
New
Hi everyone!
This is our fourth edition. Last year, 1,000+ developers took part. The more of you who answer, the more useful the results...
New
Over the years I’ve tried dozens of time tracking and invoicing apps, and Harvest was the only one I liked. Primarily due to its relative...
New
Hi everyone,
I asked Claude (Anthropic’s AI) a question: if AI writes most of the code, what should a language on the BEAM look like? It...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hi everyone :waving_hand:
I’ve been working on PhiaUI, an open-source UI component library for Phoenix LiveView, and I wanted to share i...
New
On November 23, 2026, an unauthorized third party exploited a vulnerability in hex.pm (CVE-2026-129514, CVSS 10.0) that let them run comm...
New
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #code-sync
- #exunit
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #ai
- #authentication
- #elixirconf-us
- #umbrella
- #full-time-contract
- #blog-post
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-eu
- #distillery
- #security
- #processes
- #api
- #forms
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
ruslandoga
Some ideas:
settingit was already set+sbwt noneto avoid busy wait consuming the allocated CPU slice (might be irrelevant in this benchmark if there is no wait under load)ensuringshould be done automatically already: OTP 23 Highlights - Erlang/OTPSystem.onilne_schedulersis equivalent to the available CPUs inside the container:jsonwrkHowever, all of these steps are not common among Elixir developers, so I think the benchmarked app is about as representative (of what we typically write) as it gets. And the benchmark itself highlights some areas for possible improvement
josevalim
The issue is not Postgrex, but rather the fact it is comparing Ecto (which would be akin to a ORM):
https://github.com/antonputra/tutorials/blob/59d29deeb57b1a81fe9c2c5e4dcb44e96c6bedb8/lessons/230/elixir-app/lib/app/router.ex#L62-L73
With something that directly sends INSERT commands over the connection:
https://github.com/antonputra/tutorials/blob/main/lessons/230/go-app/device.go#L30-L33
And if you are going to set up 500 database connections, I would at least split over a few connection pools (by setting
pool_count). Otherwise you are likely making the pool the bottleneck.Overall, I’d expect the Go to have better throughput, but there is definitely a bit of apples to oranges going on. I honestly don’t understand why benchmark authors do not ask for some community vetting before publishing.
D4no0
The first test where it was mentioned that go uses a performant third-party JSON library vs using
Jasonin elixir is also geared towards putting go in a better light.If raw performance is the main scope, then he could have used a library like
jiffyor to make the comparison fair (since using NIFs can be called cheating), only limit to standard library.dimitarvp
What responses to that video would you have liked to see?
shishini
To re-iterate few points , I am very new to elixir
i was expecting elixir to be slower, but to do better on availability
So i was expecting replies on how to improve the benchmark where elixir should naturally do better than Go , which is availability
In other words, what is the trade off, what are we sacrificing performance for?
dimitarvp
Are you not satisfied with the answer that more DB connections should be given in the pool?
D4no0
If this current implementation handles 10k req/s comapred to 60k/s on golang side, how can it by design provide availability? I am missing something on how that measurement is done?
Set the timeout on requests to longer times and you will receive the responses, as the nature of how schedulers work in erlang is that the more processes you have to handle (in this case 1 connection = 1 process most probably), the slower all the system becomes.
realcorvus
IMO Elixir is much better than Go for a backend, and the thing all these benchmarks miss is the reality of how apps are actually used. The real environment a backend operates in can be thought of as rough terrain, while a benchmark environment is a paved road. These benchmarks take Elixir (a Land Cruiser SUV) and Go (a Corolla), measure how fast the car can go one mile burning x amount of fuel, and conclude the Corolla is a better car because the numbers are better. Meanwhile people who actually have to get over rough terrain drive the Land Cruiser.
There’s a highly upvoted post on the Go subreddit about a nil deference crashing the entire app and causing $100k in lost revenue. https://www.reddit.com/r/golang/comments/18sncxt/go_nil_panic_and_the_billion_dollar_mistake/
It seems extremely unlikely for a similar programming mistake to take down an Elixir app.
josevalim
A couple more differences after looking into the serialization aspect:
They are using
Jason.encode!instead of the more efficientJason.encode_to_iodata!. Doing this change makes it 30% faster on my machine and drastically reduces memory allocation (this is what Phoenix’jsonwould have done by default)They are not using the derived App.Device when encoding, which means the shape is not preallocated
The Go version encodes the current time once. The Elixir version encodes it 4x (twice to send it to the database, twice for JSON). Those things tend to cause a large difference in benchmarks, I replaced it here and it brought a 10%-20% improvement
Honestly, I don’t understand why it suddenly falls over in the first test. However, without a way to reproduce it, it is impossible for me to answer it. I cannot reproduce it on my machine. I am confidently pushing over 80k req/s (while Go sits at 110k).
josevalim
Here is a pull request that makes the Elixir code closer to the code in Go and uses better defaults (for example, what Phoenix would have used): Make benchmarks with Elixir fairer by josevalim · Pull Request #370 · antonputra/tutorials · GitHub