# Ways to speed up QC plots computation

**URL:** <https://discuss.hail.is/t/ways-to-speed-up-qc-plots-computation/2221>\
**Category:** Hail Query & hailctl\
**Created:** [September 1, 2021, 8:05am UTC](https://discuss.hail.is/t/ways-to-speed-up-qc-plots-computation/2221 "2021-09-01T08:05:04Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![patrick-schultz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/patrick-schultz/32/265_2.png) [@patrick-schultz](https://discuss.hail.is/u/patrick-schultz)\
**Post date:** [September 1, 2021, 1:33pm UTC](https://discuss.hail.is/t/ways-to-speed-up-qc-plots-computation/2221/2 "2021-09-01T13:33:43Z")

</div>

Hi Abhishek,

If you don’t pass a range, `histogram` will do the following computation:

```python
start, end = mt.aggregate_entries((hl.agg.min(mt.DP), hl.agg.max(mt.DP)))
dp_hist = mt.aggregate_entries(hl.agg.hist(mt.DP, start, end, bins))

```

If you do pass a range, it will only compute the second step. So if you are doing the same thing and passing the result to `histogram`, it will make no performance difference. However, one benefit of doing the aggregation yourself is that you can save `dp_hist`, and regenerate the plot without rerunning the aggregation.

If you’re doing exploratory analysis and might want to try plotting with different numbers of bins, `histogram` can also take the results of the `approx_cdf` aggregator, which is a more sophisticated stigmatization of a distribution of values (see [[Feature] Approximate quantiles, cdf and pdf plots](https://discuss.hail.is/t/feature-approximate-quantiles-cdf-and-pdf-plots/925) for more details). With the `interactive=True` flag, you can interactively modify the number of bins in the histogram. The tradeoff is that it won’t be as accurate as a `hist` aggregator with predetermined number of bins.

---

_[View the full topic](https://discuss.hail.is/t/ways-to-speed-up-qc-plots-computation/2221)._
