How is the performance of elixir for video streaming?

I was working in python with video streaming app, and i want to learning performance of elixir for video streaming, like tiktok or YouTube, elixir will give me performance of python?

1 Like

I’m not a Elixir guru but I think if you want to create high demand video streaming app then I would separate the streaming part of the app. By that I mean that part just streams the video. That should be written in language that can be used to get high performance streaming like Go, Rust, C++ and maybe C#. If I remember correctly creator of GitHub - valyala/fasthttp: Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http created it for Go because of his needs of video streaming performance. Then logic part for the app would be written in another language.

This way is my understanding how many game services work as well. Example Microsoft’s Halo game services where written in C# using their open source Orleans framework. It handled everything that was not latency sensitive. Like transferring items, keeping game session state, leaderboard etc. Then you have latency optimized server code for the gameplay itself transferring UDP packets between players or between players & server. That means thing like player movement, bullets movement etc., anything latency sensitive. If I remember correctly they where using C++ in Halo’s case for this.

tnx so much much for ur comment, appreciated

You may want to take a look at the Membrane Framework in Elixir https://www.membraneframework.org

As far as performance goes, Membrane is well optimized as it delegates the heavy number crunching to C. Obviously you’ll want to make some PoCs and see what suites your needs, but Membrane might provide with some great video streaming functionality.

2 Likes

did you used it in any project, or test it?

It’s important to keep in mind that Erlang and the BEAM were originally built for telecommunications. Low latency delivery of audio messages (phone calls) with fault tolerance are baked into its DNA. Specific Elixir approaches and/or libraries can make a big difference, but I would expect it can beat Python in this area.

Things are complicated by the fact that you probably don’t mean pure Python, but instead Python wrappers over other language code. Elixir can do that too, but then you’d have to dig into those lower level languages and libraries to make performance determinations.

Or, you can avoid analysis paralysis and do as @akoutmos said and put together a proof of concept.

4 Likes

I understood very well, tnx so much :slight_smile: