Live data from Hacker News

Elixir saves Pinterest $2M a year in server costs

paraxial.io

271–280 of 481 posts

Re: Elixir saves Pinterest $2M a year in server costs

#271

Earlier quoted context omitted.

I can see how you would think that, yes. In practice I haven't noticed it except in super rare cases where processes (actors) hold on to huge binaries / strings -- which is one of the weak points of BEAM's GC.

The big offenders is serializing huge jsons and chucking small binaries slices from that into an ets table. Also concatenating binaries. Don't do that, use an iolist

Yep. Has bitten me in the bottom before.

Re: Elixir saves Pinterest $2M a year in server costs

#273
post #252

Earlier quoted context omitted.

This is a pretty realistic balanced real-world benchmark of web frameworks (and languages): https://www.techempower.com/benchmarks/ It shows that Python with Django is literally 40 times slower than the fastest framework. Python with uvicorn is 10 times slower. The use of languages like Python and Ruby literally results in >10x the servers being used; which not only results in higher cost, but also greater electricit…

> This is a pretty realistic balanced real-world benchmark of web frameworks (and languages): https://www.techempower.com/benchmarks/ Did you even ever see implementation behind techempower benchmarks? There's NOTHING realistic in them. Those applications literally hardcode static content length header values to be faster. They are pretty good show of how low you can get to squeeze out performance but not one sane pe…

I've only skimmed some of the code, but fwiw, anyone can read their code for each framework that's benchmarked here: https://github.com/TechEmpower/FrameworkBenchmarks/tree/mast...

There's also a good amount of active discussion going on here: https://github.com/TechEmpower/FrameworkBenchmarks/discussio...

Here's the code for the JS (just-js) benchmark: https://github.com/TechEmpower/FrameworkBenchmarks/blob/mast...

And here's the code for the Python uvicorn benchmark: https://github.com/TechEmpower/FrameworkBenchmarks/blob/mast...

From some light skimming, the JS and Python code doesn't look particularly abnormal or overly-optimized.

Re: Elixir saves Pinterest $2M a year in server costs

#275

Earlier quoted context omitted.

Frankly I am seeing that as a myth, you seem to have made up your mind some time ago or judged by 1-2 occasions. I am on ElixirForum every day and worked with Elixir for 7 years and have never seen anyone "perpetuate myths". I've seen some people willing to "increase adoption" which was always met with resistance by the wider community -- we believe growth should be organic. Pretty sad stance from you though, I have…

> If you are not willing to try it, that's fair. Say that. Claiming you know stuff about the ecosystem while a guy who is there every day comes across as... strange. Biased. And not arguing in good faith. :( I am not willing to drag others, such as those that wrote the repos, into a technical discussion with people out to act as you are.

I really don't get your replies and why their tone has to be the way it is but, have it your way. I tried.

Re: Elixir saves Pinterest $2M a year in server costs

#276
post #266
post #151

Earlier quoted context omitted.

> ... with 1/50th the effort of any other language. To junior developers reading this, such statements are never true.

If I had said 1/4th the effort would that have invalidated my argument? I pulled that figure out of my arse from experience. YMMV. You'll note I'm not selling anything here, and no one is paying me a commission. A junior that got "swindled" by my claims and spends a weekend learning Elixir becomes a better programmer and earns another feather on their cap. How tragic. Junior devs, if you want to become a senior greyb…

He just means that junior developers don’t understand hyperboles because they don’t have the intuition yet.

Re: Elixir saves Pinterest $2M a year in server costs

#279

Earlier quoted context omitted.

This is a pretty realistic balanced real-world benchmark of web frameworks (and languages): https://www.techempower.com/benchmarks/ It shows that Python with Django is literally 40 times slower than the fastest framework. Python with uvicorn is 10 times slower. The use of languages like Python and Ruby literally results in >10x the servers being used; which not only results in higher cost, but also greater electricit…

Going from > greater electricity use, and pollution and carbon emissions if the grid where the data center is located uses fossil fuels . to > dynamically-typed languages damage the environment as they're typically an order of magnitude slower is quite a stretch. Do dynamically-typed languages inherently damage the environment? Or is it the fossil fuels? Not that the appeal to the environment matters, because later o…

> Do dynamically-typed languages inherently damage the environment? Or is it the fossil fuels?

My opinion is that slow languages that use 10x the electricity, with no ROI for the 10x energy use is bad.

High energy use, even if it's clean energy, implies a higher environmental toll. If a country were solely using nuclear and solar, higher energy use results in (1) more nuclear reactors constructed, and (2) more solar panels built. The manufacture and construction of both has an environment cost. Of course, with fossil fuels, the damage to the environment is potentially a lot worse.

> Not that the appeal to the environment matters

I don't think higher energy use is inherently bad. If we can improve the quality of life for human beings, then IMO a higher energy use is justified. I don't really believe in degrading our quality of life to lower our energy use.

My problem with many popular slow languages is that they have a negative ROI for the higher electricity cost. In exchange for 10x the energy use, you have a language that results in less-readable code (a serious issue), that causes more bugs / less-reliable software, etc. We literally a get negative ROI in exchange for 10x the energy use. Which is absurd and illogical.

If Hindley–Milner type inference had been more prevalent in the 1990s, I have a feeling dynamically-typed languages would have never take off. We're moving back to static typing with mypy, TypeScript, etc., but I'm hoping we move away entirely soon from using slow languages for writing servers serving large numbers of users.

If we actually got something in exchange for it, it wouldn't bother me so much.

Re: Elixir saves Pinterest $2M a year in server costs

#280
post #238
post #199

Earlier quoted context omitted.

I wrote the same kind of tool in both Elixir and Go, the performance difference was huge between the two, Elixir / Erlang is pretty slow overall.

The go runtime has similar capabilities as the BEAM runtime when it comes to concurrent workloads. Go has the benefit of being a typesafe compiled language which gives it speed benefits. But using either one of them instead of Java is probably going to be a huge win for most teams on concurrent workloads.

> But using either one of them instead of Java is probably going to be a huge win for most teams on concurrent workloads

Not for long. Something is looming on the horizon in Java-land.

Post reply on HN