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

dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
Kagamiiiii
Student & New to elixir. Nice language. I want to convert a english character, e.g. “a”, which is stored in a variable, to it’s asci...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
idi527
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir iex(2)...
New

Other popular topics Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
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
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
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 42633 214
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

We're in Beta

About us Mission Statement