How to speed up accidental large output?

From time to time I accidentally let large expressions like RandomReal[1., {10^5, 10, 10}] reach the front end. The computation of the result is quite fast (AbsoluteTiming gives 0.0896609), but the kernel will still take a very long time, just to finally display the 'large output' widget.

Sometimes I can abort the "output-computation" to avoid waiting, but I cannot know when the actual computation that I want to finish ends.

Is there a way to have the front-end do something different on large output? Maybe applying something like Short to large results instead of the 'large output' widget, though Short also seems to be slow. Dimensions might be preferable.

Are there any hooks for this?

$PrePrint = If[ByteCount[#] > 10^6, Shallow[#, 1], #] &  Maybe something more fancy is needed to pass larger Graphics, it is up to you. You can put it init.m analogously to: What bug fixes can be implemented in init.m? • Unfortunately, this causes weird and hard-to-track error messages with say Plot3D: After setting this, e.g. Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}, PerformanceGoal -> "Quality", PlotPoints -> 100, BoxRatios -> Automatic] will print an error message saying "Skeleton is not a Graphics3D primitive or directive" – masterxilo Aug 16 '16 at 16:05 • @masterxilo That is what I was anticipating in the line below the code block. You can try to adjust it, analogously to: Why are graphics rendered as MathML when I set$PrePrint = MathMLForm? – Kuba Aug 16 '16 at 18:32