Skip to content

Commit 8f03a10

Browse files
committed
regen dev checklist
1 parent 0ed4f89 commit 8f03a10

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

doc/Developer-checklist.xml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<refsect3 xml:id="if-you-can-use-thumbnail-not-resize">
1717
<title>If you can, use <literal>thumbnail</literal>, not <literal>resize</literal></title>
1818
<para>
19-
The <literal>thumbnail</literal> operation combines load and resize into one step. This lets it take advantage of format library features, such as shrink on load, and can lead to a large improvement in speed and drop in memory use.
19+
The <literal>thumbnail</literal> operation combines load and resize into one step. This lets it take advantage of format library features, such as shrink on load, and can lead to a large improvement in speed and a large drop in memory use.
2020
</para>
2121
<para>
2222
For example, with this JPEG image:
@@ -40,7 +40,7 @@ $ /usr/bin/time -f %M:%e vips thumbnail nina.jpg x.jpg 605
4040
68864:0.08
4141
</programlisting>
4242
<para>
43-
Now it’s 68 MB of memory and 0.08s – half the memory use, and 3x faster. In fact the improvement is better than that, since the `<literal>vips</literal> command takes a while to start and needs a fair amount of memory:
43+
Now it’s 68 MB of memory and 0.08s – half the memory use, and 3x faster. In fact the improvement is better than that, since the <literal>vips</literal> command takes a while to start and needs a fair amount of memory:
4444
</para>
4545
<programlisting>
4646
$ /usr/bin/time -f %M:%e vips &gt; /dev/null
@@ -65,21 +65,30 @@ $ /usr/bin/time -f %M:%e vips &gt; /dev/null
6565
This is a hint you pass to <literal>new_from_file</literal> and friends that signals that you will only scan this image in the direction that the underlying load library supports. This can give a useful improvement in speed and reduction in memory use in many cases.
6666
</para>
6767
<para>
68-
See <link xlink:href="How-it-opens-files.html">the <quote>How it opens files</quote></link> chapter for background on this feature.
68+
See <link xlink:href="How-it-opens-files.html">the <quote>How it opens files</quote> chapter</link> for background on this feature.
6969
</para>
7070
</refsect3>
7171
<refsect3 xml:id="use-longer-pipelines-if-you-can">
7272
<title>Use longer pipelines if you can</title>
7373
<para>
74-
libvips is demand-driven, and uses <emphasis>partial images</emphasis> as intermediates. This means you can construct long pipelines of image processing operations, they won’t use much memory, and they’ll (usually) join efficiently.
74+
libvips is demand-driven, and uses partial images as intermediates. This means you can construct long pipelines of image processing operations, they won’t use much memory, and they’ll (usually) join efficiently.
7575
</para>
7676
<para>
77-
libvips is <emphasis>horizontally threaded</emphasis>, meaning that threads run along the pipeline of operations you are evaluating, not up and down images. This means that libvips can (usually) parallelise longer pipelines more efficiently than short ones.
77+
libvips is horizontally threaded, meaning that threads run along the pipeline of operations you are evaluating, not up and down images. This means that libvips can (usually) parallelise longer pipelines more efficiently than short ones.
7878
</para>
7979
<para>
8080
If you can, aim for long pipelines of processing operations.
8181
</para>
8282
</refsect3>
83+
<refsect3 xml:id="cache-commonly-reused-images">
84+
<title>Cache commonly reused images</title>
85+
<para>
86+
If an image is reused repeatedly in one pipeline, it’ll be recomputed each time. You can sometimes get a big speedup by keeping images like this in memory rather than recalculating their pixels, see (for example), <literal>copy_memory()</literal> in pyvips.
87+
</para>
88+
<para>
89+
This can raise memory use, of course.
90+
</para>
91+
</refsect3>
8392
<refsect3 xml:id="adjust-the-order-of-operations-in-pipelines">
8493
<title>Adjust the order of operations in pipelines</title>
8594
<para>
@@ -120,7 +129,7 @@ $ /usr/bin/time -f %M:%e vips &gt; /dev/null
120129
Check for interlaced (also called progressive) images.
121130
</para>
122131
<para>
123-
These are the ones that appear at a low res first, then slowly fill in detail as they are downloaded.
132+
These are the ones that appear in low detail first, then progressively sharpen as they are downloaded.
124133
</para>
125134
<para>
126135
The downside is that you don’t get the final pixels until the whole image is in memory, which prevents any streaming processing and hugely increases memory use. For example:
@@ -156,7 +165,7 @@ $ /usr/bin/time -f %M:%e vipsthumbnail x.jpg
156165
<refsect3 xml:id="disable-the-libvips-operation-cache-if-you-dont-need-it">
157166
<title>Disable the libvips operation cache if you don’t need it</title>
158167
<para>
159-
The libvips operation cache is not useful for image proxies (i.e. processing many different images). Consider disabling this with <literal>vips_cache_set_max(0);</literal>.
168+
The libvips operation cache is not useful for image proxies (i.e. processing many different images). Consider disabling this with <literal>vips_cache_set_max(0);</literal>.
160169
</para>
161170
</refsect3>
162171

0 commit comments

Comments
 (0)