I occasionally end up with a notebook that is excessively slow in the front-end because of its size. Often it's some animation. How can I use Mathematica to find the large cell responsible for this?

Here's an example notebook where I ended up with this problem.

  • 1
    $\begingroup$ maybe something like ReverseSortBy[Cells[EvaluationNotebook[], GeneratedCell -> True], ByteCount@NotebookRead@# &]? $\endgroup$
    – kglr
    Nov 19, 2023 at 2:01
  • $\begingroup$ You could try using ``ResourceFunction["NotebookCellData"][]` $\endgroup$
    – Carl Woll
    Nov 21, 2023 at 17:15
  • $\begingroup$ Related question: Notebook cells space on disk profiler $\endgroup$ Nov 23, 2023 at 3:11

2 Answers 2


Maybe something like:

Map[Tooltip[#, ByteCount@NotebookRead@#] &] @
 TakeLargestBy[Cells[EvaluationNotebook[], GeneratedCell -> True], 
  ByteCount @ NotebookRead @ # &, 10]

enter image description here

Click on the button to go the target cell.


NotebookCellData gives a slightly nicer formatted table. Looks like a single vector graphics can push 50MB, makes sense to Rasterize.

notebookCellData = 
   ResourceSystemBase -> 
   EvaluationNotebook[], {"CellByteCount"}], #CellByteCount &], 

enter image description here


This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .