Retidy, removing align=left from headings and empty paragraphs
This commit is contained in:
parent
7b08bb15c6
commit
a96a114403
362 changed files with 8472 additions and 5040 deletions
33
59-06.html
33
59-06.html
|
|
@ -1,5 +1,4 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
|
|
@ -19,17 +18,21 @@
|
|||
<center>
|
||||
<table border="1">
|
||||
<tr>
|
||||
<td><a href="59-05.html">Previous</a></td>
|
||||
<td>
|
||||
<a href="59-05.html">Previous</a>
|
||||
</td>
|
||||
|
||||
<td><a href="index.html">Table of Contents</a></td>
|
||||
<td>
|
||||
<a href="index.html">Table of Contents</a>
|
||||
</td>
|
||||
|
||||
<td><a href="60-01.html">Next</a></td>
|
||||
<td>
|
||||
<a href="60-01.html">Next</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
|
||||
<p><br /></p>
|
||||
|
||||
<p>Things change when maximum optimization is selected, however: The performance of the two implementations becomes virtually identical! How can this be? Part of the answer is that the compiler does an amazingly good job with Listing 59.2. Most impressively, when compiling Listing 59.2, the compiler actually converts all right-subtree descents from code recursion to data recursion, by simply jumping back to the left-subtree handling code instead of recursively calling <b>WalkTree()</b>. This means that half the time Listing 59.4 has no advantage over Listing 59.2; in fact, it’s at a disadvantage because the code that the compiler generates for handling right-subtree descent in Listing 59.4 is somewhat inefficient, but the right-subtree code in Listing 59.2 is a marvel of code generation, at just 3 instructions.</p>
|
||||
|
||||
<p>What’s more, although left-subtree traversal is more efficient with data recursion than with code recursion, the advantage is only four instructions, because only one parameter is passed and because the compiler doesn’t bother setting up an EBP-based stack frame, instead it uses ESP to address the stack. (And, in fact, this cost could be reduced still further by eliminating the check for a NULL <b>pNode</b> at all but the top level.) There are other interesting aspects to what the compiler does with Listings 59.2 and 59.4 but that’s enough to give you the idea. It’s worth noting that the compiler might not do as well with code recursion in a more complex function, and that a good assembly language implementation could probably speed up Listing 59.4 enough to make it measurably faster than Listing 59.2, but not even close to being <i>enough</i> faster to be worth the effort.</p>
|
||||
|
|
@ -60,7 +63,7 @@
|
|||
|
||||
<p>In the next chapter, we’ll build a BSP-tree compiler, and after that, we’ll put together a rendering system built around the BSP trees the compiler generates. If the subject of BSP trees really grabs your fancy (as it should if you care at all about performance graphics) there is at this writing (February 1996) a World Wide Web page on BSP trees that you must investigate at <a href="http://www.qualia.com/bspfaq/">http://www.qualia.com/bspfaq/</a>. It’s set up in the familiar Internet Frequently Asked Questions (FAQ) style, and is very good stuff.</p>
|
||||
|
||||
<h4 align="left" id="Heading12">Related Reading</h4>
|
||||
<h4 id="Heading12">Related Reading</h4>
|
||||
|
||||
<p>Foley, J., A. van Dam, S. Feiner, and J. Hughes, <i>Computer Graphics: Principles and Practice (Second Edition)</i>, Addison Wesley, 1990, pp. 555-557, 675-680.</p>
|
||||
|
||||
|
|
@ -70,16 +73,20 @@
|
|||
|
||||
<p>Naylor, B., “Binary Space Partitioning Trees as an Alternative Representation of Polytopes,” <i>Computer Aided Design</i>, Vol. 22(4), May 1990, pp. 250-253.</p>
|
||||
|
||||
<p><br /></p>
|
||||
|
||||
<center>
|
||||
<table border="1">
|
||||
<tr>
|
||||
<td><a href="59-05.html">Previous</a></td>
|
||||
<td>
|
||||
<a href="59-05.html">Previous</a>
|
||||
</td>
|
||||
|
||||
<td><a href="index.html">Table of Contents</a></td>
|
||||
<td>
|
||||
<a href="index.html">Table of Contents</a>
|
||||
</td>
|
||||
|
||||
<td><a href="60-01.html">Next</a></td>
|
||||
<td>
|
||||
<a href="60-01.html">Next</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
|
|
|
|||
Loading…
Reference in a new issue