This file is indexed.

/usr/share/doc/diffutils-doc/diffutils_7.html is in diffutils-doc 1:3.2-6.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- This manual is for GNU Diffutils
(version 3.2, 15 August 2011),
and documents the GNU diff, diff3,
sdiff, and cmp commands for showing the
differences between files and the GNU patch command for
using their output to update files.

Copyright C 1992-1994, 1998, 2001-2002, 2004, 2006, 2009-2011 Free
Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled
"GNU Free Documentation License."

 -->
<!-- Created on April 29, 2012 by texi2html 1.82
texi2html was written by: 
            Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <texi2html-bug@nongnu.org>
-->
<head>
<title>Comparing and Merging Files: 6. diff Performance Tradeoffs</title>

<meta name="description" content="Comparing and Merging Files: 6. diff Performance Tradeoffs">
<meta name="keywords" content="Comparing and Merging Files: 6. diff Performance Tradeoffs">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.82">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.roman {font-family:serif; font-weight:normal;}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">

<a name="diff-Performance"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="diffutils_6.html#Pagination" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="diffutils_8.html#Comparing-Three-Files" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="diffutils_6.html#Adjusting-Output" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="diffutils.html#Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="diffutils_8.html#Comparing-Three-Files" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="diffutils.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="diffutils_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="diffutils_22.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="diffutils_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="diff-Performance-Tradeoffs"></a>
<h1 class="chapter">6. <code>diff</code> Performance Tradeoffs</h1>
<a name="index-performance-of-diff"></a>

<p><acronym>GNU</acronym> <code>diff</code> runs quite efficiently; however, in some
circumstances you can cause it to run faster or produce a more compact
set of changes.
</p>
<p>One way to improve <code>diff</code> performance is to use hard or
symbolic links to files instead of copies.  This improves performance
because <code>diff</code> normally does not need to read two hard or
symbolic links to the same file, since their contents must be
identical.  For example, suppose you copy a large directory hierarchy,
make a few changes to the copy, and then often use &lsquo;<samp>diff -r</samp>&rsquo; to
compare the original to the copy.  If the original files are
read-only, you can greatly improve performance by creating the copy
using hard or symbolic links (e.g., with <acronym>GNU</acronym> &lsquo;<samp>cp -lR</samp>&rsquo; or
&lsquo;<samp>cp -sR</samp>&rsquo;).  Before editing a file in the copy for the first time,
you should break the link and replace it with a regular copy.
</p>
<p>You can also affect the performance of <acronym>GNU</acronym> <code>diff</code> by
giving it options that change the way it compares files.
Performance has more than one dimension.  These options improve one
aspect of performance at the cost of another, or they improve
performance in some cases while hurting it in others.
</p>
<p>The way that <acronym>GNU</acronym> <code>diff</code> determines which lines have
changed always comes up with a near-minimal set of differences.
Usually it is good enough for practical purposes.  If the
<code>diff</code> output is large, you might want <code>diff</code> to use a
modified algorithm that sometimes produces a smaller set of
differences.  The &lsquo;<samp>--minimal</samp>&rsquo; (&lsquo;<samp>-d</samp>&rsquo;) option does this;
however, it can also cause <code>diff</code> to run more slowly than
usual, so it is not the default behavior.
</p>
<p>When the files you are comparing are large and have small groups of
changes scattered throughout them, you can use the
&lsquo;<samp>--speed-large-files</samp>&rsquo; option to make a different modification to
the algorithm that <code>diff</code> uses.  If the input files have a constant
small density of changes, this option speeds up the comparisons without
changing the output.  If not, <code>diff</code> might produce a larger set of
differences; however, the output will still be correct.
</p>
<p>Normally <code>diff</code> discards the prefix and suffix that is common to
both files before it attempts to find a minimal set of differences.
This makes <code>diff</code> run faster, but occasionally it may produce
non-minimal output.  The &lsquo;<samp>--horizon-lines=<var>lines</var></samp>&rsquo; option
prevents <code>diff</code> from discarding the last <var>lines</var> lines of the
prefix and the first <var>lines</var> lines of the suffix.  This gives
<code>diff</code> further opportunities to find a minimal output.
</p>
<p>Suppose a run of changed lines includes a sequence of lines at one end
and there is an identical sequence of lines just outside the other end.
The <code>diff</code> command is free to choose which identical sequence is
included in the hunk.  In this case, <code>diff</code> normally shifts the
hunk&rsquo;s boundaries when this merges adjacent hunks, or shifts a hunk&rsquo;s
lines towards the end of the file.  Merging hunks can make the output
look nicer in some cases.
</p>
<hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="diffutils_6.html#Adjusting-Output" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="diffutils_8.html#Comparing-Three-Files" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="diffutils.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="diffutils_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="diffutils_22.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="diffutils_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
 <font size="-1">
  This document was generated by <em>root</em> on <em>April 29, 2012</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
 </font>
 <br>

</p>
</body>
</html>