# How to extract histogram from @benchmark results

**URL:** https://discourse.julialang.org/t/how-to-extract-histogram-from-benchmark-results/131245
**Category:** General Usage
**Tags:** benchmarktools
**Created:** [July 31, 2025, 10:32am UTC](https://discourse.julialang.org/t/how-to-extract-histogram-from-benchmark-results/131245 "2025-07-31T10:32:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![JJMerelo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jjmerelo/32/217998_2.png) [@JJMerelo](https://discourse.julialang.org/u/JJMerelo)
#### Post date: [July 31, 2025, 10:32am UTC](https://discourse.julialang.org/t/how-to-extract-histogram-from-benchmark-results/131245/1 "2025-07-31T10:32:52Z")

</div>

How can we see the histogram results as shown in from the Julia prompt?

---

<div class="post-metadata">

### Author: ![JJMerelo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jjmerelo/32/217998_2.png) [@JJMerelo](https://discourse.julialang.org/u/JJMerelo)
#### Post date: [July 31, 2025, 11:15am UTC](https://discourse.julialang.org/t/how-to-extract-histogram-from-benchmark-results/131245/2 "2025-07-31T11:15:29Z")

</div>

Apparently, you can use `display` which will be very close to what you get in the Julia prompt. `println` will give you the gist of it, `dump` lots of attributes.

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [July 31, 2025, 11:23am UTC](https://discourse.julialang.org/t/how-to-extract-histogram-from-benchmark-results/131245/3 "2025-07-31T11:23:35Z")

</div>

> [@JJMerelo](#):
>
> Apparently, you can use `display` which will be very close to what you get in the Julia prompt.

Yes, the REPL calls `display`. However, the output of `display` in general may depend on the environment (e.g. it may be an image in some environments), and the environment also determines which I/O device/stream the output goes to. If you specifically want the text output, and want it sent to a particular stream `io`, you can do:

```julia-auto
show(io, "text/plain", x)

```

e.g. with `io = stdout`, which is what `display` calls under the hood for the default text output situation.

See also the [summary of output functions](https://github.com/JuliaLang/julia/blob/master/doc/src/manual/types.md#output-function-summary) which should be in the next (1.12) version of the Julia manual.

(The actual data of the histogram from `x = @benchmark foo` is in `x.times`, which is just a raw list of timings, from which you can plot a histogram using any of the plotting packages.)
