That's a good tip, thank you! It does indeed speed it up.
For personal use, I also use ListPlot. But when I show those plots to others, I get increasingly common complaints that they are not readable enough, etc. Thus I am compelled to produce a barchart-style thing.
In the meantime I found this suggestion to use WeightedData
. One need to take special care to line up the bins carefully between the steps of the procedure, but this works:
data = RandomVariate[ExponentialDistribution[1], 5000000];
bins = Sequence[0, 18, 0.5];
Histogram[data, {bins}, {"Log", "Count"},
PlotRange -> All] // AbsoluteTiming
Histogram[
WeightedData[MovingAverage[Range[bins], 2], BinCounts[data, {bins}]],
{bins}, {"Log", "Count"}
] // AbsoluteTiming
Luckily it doesn't prevent me from using logarithmic vertical scaling easily