Donovan

Donovan

Suitability of Elixir to math-oriented apps

Hello everyone,

I’m so glad to have discovered this awesome community. Thanks for creating it! This is my second post, and apologies for any inadvertent breach of protocol by posting this (a variation of a prior reply to a related topic) as a separate post.

I’m just learning Elixir and have encountered a few pronouncements that Elixir is slow and may not be well suited to heavy data/analytics applications. At the same time I’ve seen references to Elixir conference presentations on Big Data applications. As a result I am seeking calibration on the kinds of math-oriented/analytics apps are well suited to Erlang.

A specific use case: I am considering using Elixir/Phoenix for the backend of a Mint-like web app. The app will principally track budget/actual entries, perform predictive / Monte Carlo / scenario modeling and produce datasets for front-end rendered charts.

I’m excited to learn and apply Elixir to this task; but would like to qualify the suitability of Elixir/Phoenix to this type of app.

Thoughts?

Most Liked

josevalim

josevalim

Creator of Elixir

When we say Elixir may not be suited to do number crunching, we are usually thinking a bit beyond analytics, averages, medians, etc. Because it is not necessarily the mathematical processing that hurts but rather the lack of support for large mutable data structures that would allow us to do implement things like image processing or support vector machines efficiently.

For example, think how you would implement a 100x100 matrix in Elixir and how much copying you would need to do to change a single {x,y} pair using immutable data structures. If you need performance, your best bet is ETS or falling back to C (which is what many languages do anyway).

If you are worried about analytics on something like Mint, Elixir/Phoenix should be fine.

15
Post #8
josevalim

josevalim

Creator of Elixir

Excellent question. When you use stream, you are typically trading CPU for memory. I.e. it is more computationally expensive but it allows you to work with large or even infinite datasets.

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

The Elixir code you’ve got isn’t a particularly suitable adaptation, which isn’t particularly that uncommon when folks are getting going. By way of comparison euler/lib/euler_014.exs at master · sorentwo/euler · GitHub runs in ~4.7 seconds on my computer and it doesn’t even have any caching.

Where Next?

Popular in Discussions Top

Fl4m3Ph03n1x
Background This question comes mainly from my ignorance. Today is Black Friday, one of my favorite days of the year to buy books. One boo...
New
sashaafm
Piggy backing a bit on @dvcrn topic BEAM optimization for functions with static return type?, I’ve been trying to understand in a deeper ...
New
Ankhers
Just a little information upfront. Generally speaking, if I feel like I need to either break a pipe chain or use an anonymous function in...
New
eteeselink
Hi all, In the last days, two things happened: A blog post titled “They might never tell you it’s broken” made the rounds. It’s about ...
New
cblavier
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
jesse
Hi everyone, I hesitated to post this here because I don’t want you to think I’m spamming, but I’ve been working on a Platform-as-a-Serv...
New
chulkilee
Here are the list of HTTP client libraries/wrappers, and some thoughts on HTTP client in general. I’d like to hear from others how they w...
New
acrolink
How does the two languages compare when it comes to server side application development? Any experiences or ideas? Thank you.
New
wmnnd
The Go vs Elixir thread got me thinking: Would it be too hard to implement a simple mechanism for creating Go-style static app binaries f...
New
opsb
We’re considering our architecture from a viewpoint of scaling our traffic heavily over the next 6 months. Our current deployment is runn...
New

Other popular topics Top

danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29377 241
New
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43622 214
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36128 110
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement