Benjamin-Philip

Benjamin-Philip

Benchmark parallel calls to a function

I would like to benchmark function calls made in parallel (for example to some function in an Ecto Context, or in my case an Axon/Nx model’s function).
I don’t have much experience in benchmarking, but I am assuming in this scenario that the number of parallel calls is increased incrementally.

Here’s what I would like to find out:

  1. What is the avg speed/latency/benchmark for a certain number of parallel calls.
  2. How many parallel calls can I make before the avg speed crosses a certain threshold or before an error is passed.

As far as I know, Benchee doesn’t support this sort of benchmarking. I would prefer an Erlang/OTP native solution, though I am okay with using an external tool and exposing the function over a REST API or similar.
I’ve thought about Tsung and an API, but I feel it’s overkill and I don’t feel upto editing XML files. I don’t know if I can use it from Elixir, despite it being written in Erlang.

First Post!

dimitarvp

dimitarvp

Not sure if I am not saying that is no longer true but a while ago I think was said that benchee is not designed to benchmark parallel code – even though it has parallel facilities, you can check their README for it – so my recommendation would be:

Just make separate Elixir function that each does things slightly differently e.g. the code you want to assess whether is slower or faster, and use hyperfine with e.g. mix run -e 'MyModule.my_function(args)'.

Where Next?

Popular in Questions Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
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
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36689 110
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
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
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31525 112
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement