Remove colour attributes from body and strip most of the font tags out

This commit is contained in:
James Gregory 2013-12-30 13:57:02 +11:00
commit c1f88ddb41
362 changed files with 1632 additions and 1706 deletions

View file

@ -24,7 +24,7 @@
<!--CHAPTER=37//-->
<!--PAGES=704-706//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//--></HEAD><BODY LINK=#0000FF ALINK=#000099 VLINK=#0000FF BGCOLOR=#FFFFFF>
<!--UNASSIGNED2//--></HEAD><body>
<CENTER>
<TABLE BORDER>
@ -36,7 +36,7 @@
</TABLE>
</CENTER>
<P><BR></P>
<H4 ALIGN="LEFT"><A NAME="Heading4"></A><FONT COLOR="#000077">How Fast Is Fast?</FONT></H4>
<H4 ALIGN="LEFT"><A NAME="Heading4"></A>How Fast Is Fast?</H4>
<P>Your first question is likely to be the following: Just how fast is Listing 37.1? Is it optimized to the hilt or just pretty fast? The quick answer is: It&rsquo;s <I>fast</I>. Listing 37.1 draws lines at a rate of nearly 1 million pixels per second on my 486/33, and is capable of still faster drawing, as I&rsquo;ll discuss shortly. (The heavily optimized AutoCAD line-drawing code that I mentioned in the last chapter drew 150,000 pixels per second on an EGA in a 386/16, and I thought I had died and gone to Heaven. Such is progress.) The full answer is a more complicated one, and ties in to the principle that if it is broken, maybe that&rsquo;s okay&mdash;and to the principle of looking before you leap, also known as profiling before you optimize.</P>
<P>When I went to speed up run-length slice lines, I initially manually converted the last chapter&rsquo;s C code into assembly. Then I streamlined the register usage and used <B>REP STOS</B> wherever possible. Listing 37.1 is that code. At that point, line drawing was surely faster, although I didn&rsquo;t know exactly how much faster. Equally surely, there were significant optimizations yet to be made, and I was itching to get on to them, for they were bound to be a lot more interesting than a basic C-to-assembly port.</P>
<P>Ego intervened at this point, however. I wanted to know how much of a speed-up I had already gotten, so I timed the performance of the C code and compared it to the assembly code. To my horror, I found that I had not gotten even a two-times improvement! I couldn&rsquo;t understand how that could be&mdash;the C code was decidedly unoptimized&mdash;until I hit on the idea of measuring the maximum memory speed of the VGA to which I was drawing.</P>
@ -46,7 +46,7 @@
<P>Now it&rsquo;s true that faster line-drawing code would likely be more beneficial on faster VGAs, especially local-bus VGAs, and in slower systems. For that reason, I&rsquo;ll list a variety of potential optimizations to Listing 37.1. On the other hand, it&rsquo;s also true that Listing 37.1 is capable of drawing lines at a rate of 2.2 million pixels per second on a 486/ 33, given fast enough VGA memory, so it should be able to drive almost any non-local-bus VGA at nearly full speed. In short, Listing 37.1 is very fast, and, in many systems, further optimization is basically a waste of time.
</P>
<P>Profile before you optimize.</P>
<H4 ALIGN="LEFT"><A NAME="Heading5"></A><FONT COLOR="#000077">Further Optimizations</FONT></H4>
<H4 ALIGN="LEFT"><A NAME="Heading5"></A>Further Optimizations</H4>
<P>Following is a quick tour of some of the many possible further optimizations to Listing 37.1.
</P>
<P>The run-handling loops could be unrolled more than the current two times. However, bear in mind that a two-times unrolling gets more than half the maximum unrolling benefit with less overhead than a more heavily unrolled loop.</P>
@ -67,7 +67,7 @@
<hr width="90%" size="1" noshade>
<div align="center">
<font face="Verdana,sans-serif" size="1">Graphics Programming Black Book &copy; 2001 Michael Abrash</font>
Graphics Programming Black Book &copy; 2001 Michael Abrash
</div>
<!-- all of the reference materials (books) have the footer and subfoot reveresed -->
<!-- reference_subfoot = footer -->