On 10/25/2003 6:27 AM, Gabor Szabo wrote: > > The HTML files generated by Devel::Cover are huge. I think some work should > be done to reduce this size. I made a simple change - removing leading spaces > from the templates - this reduced the file size by about 60% for > HTML::Template. > > It is still huge ~870K but I could not find any easy way to remove further > large chunks without changing the resulting page.
You won't find any more low hanging fruit. There's a lot of markup in building that table, so it's necessarily large (and by nature will typically be several times larger than the source file). The next best way to get smaller report files is to only include the coverage metrics you care about. There's a minimum of about 10 characters per metric for each line of source code, so it adds up quickly. If you won't be viewing the file with IE (which doesn't honor "white-space: pre" CSS) you could comment out these lines in Devel/Cover/Report/HTML_subtle.pm: $line{text} =~ s/\t/ /g; # line 160 $line{text} =~ s/\s/ /g; # line 161 That might yield a small boost if your source files have lots of indentation. > What do you think about removing > 1) the lines from the source code which are empty > 2) removing the lines that display parts of the documentation ? The report already trims text after __DATA__ and __END__ tags, so trimming POD seems reasonable, although it will require some added intelligence. I'm a little mixed on trimming blank lines. I like the code column to look just like the source code. A compromise might might be possible, if you're willing to sacrifice a little consistency in the format. -mjc