Deduped images

This commit is contained in:
James Gregory 2013-12-30 12:25:34 +11:00
commit 9e52de9586
233 changed files with 128 additions and 128 deletions

View file

@ -130,7 +130,7 @@ neighbor_count++;
<P>The neighbor-counting code is brought into <B>next_generation,</B> eliminating many function calls and from-scratch address/mask calculations; all multiplies are eliminated by using pointers and addition; and all cells are accessed directly via pointers and masks, eliminating all remaining function calls and from-scratch address/mask calculations.</P>
<P>The net effect of these optimizations is that Listing 17.4 is more than twice as fast as Listing 17.3; we&#146;ve achieved the desired 18 generations per second, albeit only on a 486, and only at 96&#215;96. (The <B>#define</B> that enables code limiting the speed to 18 Hz, which seemed ridiculous in Listing 17.1, is actually useful for keeping the generations from iterating too quickly when Listing 17.4 is running on a 486, especially with a small cellmap like 48&#215;48.) We&#146;ve sped things up by about eight times so far; we need to increase our speed another ten times to reach our goal of 200&#215;200 at 18 generations per second on a 20 MHz 386.</P>
<P>It&#146;s undoubtedly possible to improve the performance of Listing 17.4 further by fine-tuning the code, but no tremendous improvement is possible that way.</P>
<TABLE WIDTH="100%"><TD VALIGN="TOP" ALIGN="LEFT" WIDTH="5%"><IMG SRC="images/17-03i.jpg"><TD VALIGN="TOP" ALIGN="LEFT" WIDTH="95%"><I><SMALL>Once you&#146;ve reached the point of fine-tuning pointer usage and register variables and the like in C or C<SMALL>&#43;&#43;</SMALL>, you&#146;ve become compiler-dependent; you therefore might as well go to assembly and get the real McCoy.</SMALL></I>
<TABLE WIDTH="100%"><TD VALIGN="TOP" ALIGN="LEFT" WIDTH="5%"><IMG SRC="images/i.jpg"><TD VALIGN="TOP" ALIGN="LEFT" WIDTH="95%"><I><SMALL>Once you&#146;ve reached the point of fine-tuning pointer usage and register variables and the like in C or C<SMALL>&#43;&#43;</SMALL>, you&#146;ve become compiler-dependent; you therefore might as well go to assembly and get the real McCoy.</SMALL></I>
</TABLE>
<P><BR></P>
<CENTER>