# Chairmarks supports comparative benchmarking!

**URL:** <https://discourse.julialang.org/t/chairmarks-supports-comparative-benchmarking/124166>\
**Category:** Package Announcements\
**Created:** [December 25, 2024, 2:42pm UTC](https://discourse.julialang.org/t/chairmarks-supports-comparative-benchmarking/124166 "2024-12-25T14:42:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lilith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lilith/32/27492_2.png) [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Post date:** [December 25, 2024, 2:42pm UTC](https://discourse.julialang.org/t/chairmarks-supports-comparative-benchmarking/124166/1 "2024-12-25T14:42:07Z")

</div>

Chairmarks version 1.3.0 supports benchmarking two (or more) functions at the same time. Simply provide the functions separated by commas:

```julia
julia> @b rand(3) objectid
4.257 ns

julia> @b rand(3) hash
7.360 ns

julia> @b rand(3) objectid,hash
(4.182 ns, 7.342 ns)

```

This usage and syntax is currently experimental, so please try it out and let me know [here](https://github.com/LilithHafner/Chairmarks.jl/issues/new) or in this thread if you encounter any issues or have feedback to share before I finalize this feature 🙂

When benchmarking two functions simultaneously, they each recieve the same number of evaluations and samples are interleaved randomly to eliminate some sources of noise and bias you would see if you ran the benchmarks serially. It’s intended to be convenient syntax and sound semantics for a common benchmarking usecase.

---

<div class="post-metadata">

**Author:** ![Lilith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lilith/32/27492_2.png) [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Post date:** [December 26, 2024, 2:02pm UTC](https://discourse.julialang.org/t/chairmarks-supports-comparative-benchmarking/124166/2 "2024-12-26T14:02:05Z")

</div>

To clarify the syntax here, the argument order remains the same:

```julia
@b f
@b setup f
@b setup f teardown
@b init setup f teardown

```

and if `f` is a tuple syntactically, then we use comparative benchmarking. Other arguments are still the same for both versions, even if they are syntactic tuplse. So for example,

```julia
@b rand(),rand() fld(_...)

```

Remains unchanged whereas

```julia
@b rand(),rand() fld(_...),cld(_...)

```

used to benchmark the function `(x) -> (fld(x...),cld(x...))` and now benchmarks both the function `(x) -> fld(x...)` and the function `(x) -> cld(x...)` in parallel but measured separately.
