I'm concerned about a thing or two though, isn't the stock data generated on-demand? Why else does the game pause when you scroll past stone if you have too much?
The stocks screen is, indeed, generated on demand. The reason it takes so long is because (wild mass guessing based upon my own programming experience) the game stores a list of each individual item, and when you highlight that item's heading in the stock screen, the game scans through that list for the details. Reading the count takes but a moment (thus why loading the Z screen in the first place doesn't take ten minutes), but polling each item to determine what it is (gneiss, gabbro, plump helmet spawn, sweet pod seed, etc.), if it's part of a building, forbidden, marked for dumping, or simply lying about takes a similar moment PER STONE. It's easy to accumulate thousands, even millions of stones (even a 2x2 site contains
OVER NINE THOUSAAAND stones per Z-level) over the course of your fortress's life.
The pro trick for avoiding that lag if you want to look at other items on the third page is to move the cursor down to at least the fifth item before hitting Page Down. You can also Page Down to the fourth page and move up one item at a time.
... and seeds. For some odd reason, seeds are much worse.
Seeds can get really bad if you grow many different crops. Your typical seed will be inside a bag, inside a barrel, placed in a stockpile. That's three of those "moments" to find each seed and figure out if it's being eaten by vermin.