sandy
Hi Guys,
Just a general question, if Twitter had used Elixir/Erlang as a backend instead of Scala, would they have had even more performance? I mean if we use the same hardware for benchmarking api call requests per second how will Elixir vs Scala compare?
Is Elixir a good choice to use for Twitter like websites? Are there any drawbacks?
Thanks
Trending in Discussions
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
New
Hey there,
It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Quite interesting article Google brought me. Didn’t find any mentions about it here.
What do you think in general? Would you use togethe...
New
Since we have deprecated our Erlang sections (as we have dedicated Erlang Forums now) let’s add this thread for those who’d like to post ...
New
:warning: Security advisory: Decimal DoS vulnerability
A vulnerability has been published for decimal where very large exponents can cau...
New
What IDE or editor are you using for Elixir development?
Personally, I use Zed, and I really like it, but sometimes I wish there were a ...
New
Other Trending Topics
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Aludel - LLM Evaluation Workbench
Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
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
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
hauleth
Yes. No. Maybe. It depends. However I doubt it, as there was sh…load of money pushed into optimisations of JVM. BEAM never had such funding.
However I do not think that the VM performance is the problem for the Twitter. It is storage of data. Of course slow VM (like Ruby earlier) do not help, but BEAM vs JVM should not introduce big change there.
As good as any other language.
The main problem with Twitter is scale, not complexity of the platform as is. At scale language do not matter much (even while Erlang is famously good there, it do not solve all problems, and it still will be hard).
dimitarvp
I suggest you look through some of Discord’s blog posts. They provide excellent information on the BEAM-based systems scaling.
romenigld
for your question I know a video for this:
lucaong
I think it is a mistake to discuss performance as if it was a single measure, directly influenced by the choice of language. First of all, performance is not one single thing: page load speed, data throughput, requests per second that our system can serve, max concurrent connections, system resources necessary to run an instance of our app… these are all possible facets of performance for a web app, and each of them is a complex topic in itself.
On top of that, in a real system, each of those metrics of performance is affected by a multitude of factors. The choice of language is merely one. Real applications are designed with a multitude of constraints and goals, and the choice of technology is almost never a matter of comparing languages on a single measure of speed.
Even the “speed” of a language is not one single thing: there are completely different workloads, and most languages optimize for a few of them. It is already misleading and difficult to compare the performance of languages on the basis of specific benchmarks, doing so on hypothetical implementations of a complex application is basically impossible.
Could Twitter be written in Elixir? Yes. Would it be a good choice? I would say yes, but the same could be said of other languages. Would it be faster than the current implementation? I don’t think we can give a meaningful answer to this question.
dimitarvp
Seeing as the OPS teams of big companies hyper-optimise their available servers for the parameters where their dev choices are strong (or weak) at then I’d say switching a technology stack on an already well-working product would be a disaster of epic proportions.
Example: I’ve had customers who had very clever sysadmins who quickly figured out that the biggest app of the company – written in Ruby on Rails – required very fast CPUs but mediocre I/O speed and medium RAM sizes were fine. So they carefully picked cloud compute with those parameters and their Rails app was doing really well there.
It’s not that I like Rails (I dislike it a lot and I worked with it 6 years to have an informed opinion). But the people in that company went all-in and accepted the tradeoffs and optimised their process around them. And the results were very good.
So I think when discussing if Elixir would be a better fit for Twitter-like apps, we should more ask the questions like “But what would the load on a Twitter-like app server look like?” If there’s much more I/O load than a CPU and RAM load then a transparently-parallel language/runtime like Erlang/Elixir would do excellently.
But if you have to do millions of messages per minute which include a lot of message passing – and thus memory copying – then it’s likely that a BEAM language could perform badly and that you should look at something with [zero|small]-cost abstractions like Rust. Or just swallow the cloud bill and use whatever language you have the most programmers in your company familiar with.
It all boils down to what tradeoffs are you willing to make and live with.
jswny
Wow I just watched that talk. Elixir’s response time for their KNN testing was about 50s compared to Scala’s ~6s. With tuning and delegation to C for the number crunching with NIFs they got it down to ~30ms. Very cool, and quite impressive! Really shows why interop with C is an important part of a language. There’s a reason most of Python’s ML libs are written in C.
For comparison with JNI they got the Scala response time to ~3ms.
Another interesting takeaway was that they got the Scala response time down to ~10ms by throwing extra cores at it (8 cores to 36), but Elixir only went down to ~20s by throwing the same bump in cores at it.
sandy
Thanks everyone for the valuable answers and info