# Chairmarks.jl

**URL:** <https://discourse.julialang.org/t/chairmarks-jl/111096>\
**Category:** Package Announcements\
**Tags:** memory-allocation, benchmark, speed-optimization\
**Created:** [March 3, 2024, 4:16pm UTC](https://discourse.julialang.org/t/chairmarks-jl/111096 "2024-03-03T16:16:39Z")\
**Posts on this page:** 1\
**Showing post:** 38

<div class="post-metadata">

**Author:** ![matthias314](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Post date:** [March 7, 2024, 9:33pm UTC](https://discourse.julialang.org/t/chairmarks-jl/111096/38 "2024-03-07T21:33:05Z")

</div>

The new package looks great! However, I’m getting confused when I compare the results to BenchmarkTools.jl for microbenchmarks. Here is an example, inspired by [this thread](https://discourse.julialang.org/t/how-to-shift-bits-faster/19405):

```julia
f(x, n) = x << n
g(x, n) = x << (n & 63)

```

On my laptop I get

```julia
julia> x = UInt128(1); n = 1;
julia> @btime f($x, $n);
  4.371 ns (0 allocations: 0 bytes)
julia> @b f($x, $n)
1.341 ns
julia> @btime g($x, $n);
  2.736 ns (0 allocations: 0 bytes)
julia> @b g($x, $n)
1.341 ns

```

It’s not just that the absolute timings are different. According to `@btime`, `g` is faster than `f`, but `@b` doesn’t see any difference. How come?

---

_[View the full topic](https://discourse.julialang.org/t/chairmarks-jl/111096)._
