Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions doc/format.html
Original file line number Diff line number Diff line change
Expand Up @@ -863,27 +863,27 @@ <h2>A Note about performance</h2>
incurred. The result may greatly depend on the compiler, standard library
implementation, and the precise choice of format-string and arguments.</p>

<p>Since common stream implementations eventually call functions of the
printf family for the actual formatting of numbers, in general printf will
be noticeably faster than the direct stream operations And due to to the
<p>Common stream implementations eventually call functions of the
printf family for the actual formatting of numbers. In general, printf
will be noticeably faster than the direct stream operations due to the
reordering overhead (allocations to store the pieces of string, stream
initialisation at each item formatting, ..) the direct stream operations
would be faster than boost::format, (one cas expect a ratio ranging from 2
to 5 or more)</p>
initialisation at each item formatting, ..). The direct stream operations
would be faster than boost::format - one can expect a ratio ranging from 2
to 5 or more.</p>

<p>When iterated formattings are a performance bottleneck, performance can
be slightly increased by parsing the format string into a format object,
and copying it at each formatting, in the following way.</p>
and copying it at each formatting, in the following way:</p>

<blockquote>
<pre>
const boost::format fmter(fstring);
dest &lt;&lt; boost::format(fmter) % arg1 % arg2 % arg3 ;
</pre>
</pre>
</blockquote>

<p>As an example of performance results, the author measured the time of
execution of iterated formattings with 4 different methods</p>
execution of iterated formattings with 4 different methods:</p>

<ol>
<li>posix printf</li>
Expand All @@ -897,7 +897,7 @@ <h2>A Note about performance</h2>
</ol>

<p>the test was compiled with g++-3.3.3 and the following timings were
measured (in seconds, and ratios) :</p>
measured (in seconds, and ratios):</p>

<blockquote>
<pre>
Expand Down