Heavy Lourde
Mar. 14th, 2005 10:01 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
So I was poking around, grumping at the navigation, and wondered if I could print parts of the PHP manual. Hmm, I thought. Just how big is the thing? I grab the single-file HTML version, 10MB. Load in Firefox. Rattle talons.
Hmmmmm. FF's memusage shoots up at least 150mb. Bad sign. Print preview must be trying to use that much MORE, and thrashes so bad that it's allocating memory at modem speeds. It wasn't really going to finish. (Ed: It may have actually been a CPU issue, or even FF's allocator choking, I don't remember seeing a lot of disk activity... but that's anyone's guess.)
IE for once fares better, capping around 180mb--which is to say it actually finished. But for every page it seems to be touching all previous pages (disabling headers/footers speeds it up), leading to some alarming O(kn) runtimes! With the smallest font size and minimal margins, the manual, without annotations, comes to 2858 pages. The preview took about a half hour... by the end it had slowed to a >1sec/page crawl. o..o
Well so much for that idea. :) Things like this are an interesting comment on code scalability... a mere 10mb file becomes a problem when you use so much memory per tag that the internal representation is 15..20x larger. Since most of the document is plain text one must assume the tags are using hundreds of bytes, not 4chars*(15..20)=60..80! (While such files are unwieldy to be sure, I've wanted to edit them on occasion and found even Wordpad et al to have similar problems.)
Hmmmmm. FF's memusage shoots up at least 150mb. Bad sign. Print preview must be trying to use that much MORE, and thrashes so bad that it's allocating memory at modem speeds. It wasn't really going to finish. (Ed: It may have actually been a CPU issue, or even FF's allocator choking, I don't remember seeing a lot of disk activity... but that's anyone's guess.)
IE for once fares better, capping around 180mb--which is to say it actually finished. But for every page it seems to be touching all previous pages (disabling headers/footers speeds it up), leading to some alarming O(kn) runtimes! With the smallest font size and minimal margins, the manual, without annotations, comes to 2858 pages. The preview took about a half hour... by the end it had slowed to a >1sec/page crawl. o..o
Well so much for that idea. :) Things like this are an interesting comment on code scalability... a mere 10mb file becomes a problem when you use so much memory per tag that the internal representation is 15..20x larger. Since most of the document is plain text one must assume the tags are using hundreds of bytes, not 4chars*(15..20)=60..80! (While such files are unwieldy to be sure, I've wanted to edit them on occasion and found even Wordpad et al to have similar problems.)