<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Stream-based Parsing Made Easy</title>
	<atom:link href="http://boost-spirit.com/home/2010/01/05/stream-based-parsing-made-easy/feed/" rel="self" type="application/rss+xml" />
	<link>http://boost-spirit.com/home/2010/01/05/stream-based-parsing-made-easy/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=stream-based-parsing-made-easy</link>
	<description>Home of The Boost.Spirit Library</description>
	<lastBuildDate>Wed, 25 Jan 2012 14:26:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Sehe</title>
		<link>http://boost-spirit.com/home/2010/01/05/stream-based-parsing-made-easy/comment-page-1/#comment-27827</link>
		<dc:creator>Sehe</dc:creator>
		<pubDate>Tue, 17 May 2011 00:40:32 +0000</pubDate>
		<guid isPermaLink="false">http://boost-spirit.com/home/?p=836#comment-27827</guid>
		<description>Note that it is slow; I have ran this comparison (1000x repeated parses of about 60 different files &lt;100k, boost 1.46.1/Spirit 2042 and fully optimized release builds):

&lt;code&gt;
#if 1
    std::string contents = read(spec);
    return do_parse_attempt(contents.begin(), contents.end(), handler);
#else
    std::ifstream in(spec.c_str());
    in.unsetf(std::ios::skipws); // No white space skipping!

    // wrap istream into iterator
    boost::spirit::istream_iterator begin(in);
    boost::spirit::istream_iterator end;

    return do_parse_attempt(begin, end, handler);
#endif
&lt;/code&gt;

(read() defined below)

The copying/allocating version (using the read() helper) was done in 6.1s, the spirit::istream_iterator version in 10.9s

That is with read(...) defined as braindead:

&lt;code&gt;
    std::string read(const std::string&amp; spec)
    {   
        std::ifstream in(spec.c_str());
        in.unsetf(std::ios::skipws);
        std::string storage;
        std::copy(
                std::istream_iterator(in),
                std::istream_iterator(),
                std::back_inserter(storage));
        return storage;
    }
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Note that it is slow; I have ran this comparison (1000x repeated parses of about 60 different files &lt;100k, boost 1.46.1/Spirit 2042 and fully optimized release builds):</p>
<p><code><br />
#if 1<br />
    std::string contents = read(spec);<br />
    return do_parse_attempt(contents.begin(), contents.end(), handler);<br />
#else<br />
    std::ifstream in(spec.c_str());<br />
    in.unsetf(std::ios::skipws); // No white space skipping!</p>
<p>    // wrap istream into iterator<br />
    boost::spirit::istream_iterator begin(in);<br />
    boost::spirit::istream_iterator end;</p>
<p>    return do_parse_attempt(begin, end, handler);<br />
#endif<br />
</code></p>
<p>(read() defined below)</p>
<p>The copying/allocating version (using the read() helper) was done in 6.1s, the spirit::istream_iterator version in 10.9s</p>
<p>That is with read(&#8230;) defined as braindead:</p>
<p><code><br />
    std::string read(const std::string&amp; spec)<br />
    {<br />
        std::ifstream in(spec.c_str());<br />
        in.unsetf(std::ios::skipws);<br />
        std::string storage;<br />
        std::copy(<br />
                std::istream_iterator(in),<br />
                std::istream_iterator(),<br />
                std::back_inserter(storage));<br />
        return storage;<br />
    }<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hartmut Kaiser</title>
		<link>http://boost-spirit.com/home/2010/01/05/stream-based-parsing-made-easy/comment-page-1/#comment-1063</link>
		<dc:creator>Hartmut Kaiser</dc:creator>
		<pubDate>Fri, 22 Jan 2010 16:16:45 +0000</pubDate>
		<guid isPermaLink="false">http://boost-spirit.com/home/?p=836#comment-1063</guid>
		<description>Mark,

the release schedule is all I can refer to only as well. But I know that beta1 has been posted today, so it seems we&#039;re still on schedule.

Regards Hartmut</description>
		<content:encoded><![CDATA[<p>Mark,</p>
<p>the release schedule is all I can refer to only as well. But I know that beta1 has been posted today, so it seems we&#8217;re still on schedule.</p>
<p>Regards Hartmut</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Jarvin</title>
		<link>http://boost-spirit.com/home/2010/01/05/stream-based-parsing-made-easy/comment-page-1/#comment-1062</link>
		<dc:creator>Mark Jarvin</dc:creator>
		<pubDate>Fri, 22 Jan 2010 15:45:33 +0000</pubDate>
		<guid isPermaLink="false">http://boost-spirit.com/home/?p=836#comment-1062</guid>
		<description>When is Boost 1.42 due to be released?  Am I right in guessing early February 2010?  I&#039;m extrapolating from here: http://www.boost.org/community/review_schedule.html

Thanks!</description>
		<content:encoded><![CDATA[<p>When is Boost 1.42 due to be released?  Am I right in guessing early February 2010?  I&#8217;m extrapolating from here: <a href="http://www.boost.org/community/review_schedule.html" rel="nofollow">http://www.boost.org/community/review_schedule.html</a></p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hartmut Kaiser</title>
		<link>http://boost-spirit.com/home/2010/01/05/stream-based-parsing-made-easy/comment-page-1/#comment-933</link>
		<dc:creator>Hartmut Kaiser</dc:creator>
		<pubDate>Fri, 15 Jan 2010 19:41:34 +0000</pubDate>
		<guid isPermaLink="false">http://boost-spirit.com/home/?p=836#comment-933</guid>
		<description>Felix,

The only reason why these have not been ported yet is that nobody invested time doing it :-P.
But these iterators are still usable with Spirit 2.x (even if they live in namespace spirit::classic), so there is no real rush to port/rewrite them.

Regards Hartmut</description>
		<content:encoded><![CDATA[<p>Felix,</p>
<p>The only reason why these have not been ported yet is that nobody invested time doing it <img src='http://boost-spirit.com/home/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> .<br />
But these iterators are still usable with Spirit 2.x (even if they live in namespace spirit::classic), so there is no real rush to port/rewrite them.</p>
<p>Regards Hartmut</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Felix</title>
		<link>http://boost-spirit.com/home/2010/01/05/stream-based-parsing-made-easy/comment-page-1/#comment-931</link>
		<dc:creator>Felix</dc:creator>
		<pubDate>Fri, 15 Jan 2010 19:21:41 +0000</pubDate>
		<guid isPermaLink="false">http://boost-spirit.com/home/?p=836#comment-931</guid>
		<description>The input stream iterator is definitely a useful feature.
What about other Classic Spirit iterators?
Is there a reason why File Iterator and Position Iterator are not part of Sprit 2.x?</description>
		<content:encoded><![CDATA[<p>The input stream iterator is definitely a useful feature.<br />
What about other Classic Spirit iterators?<br />
Is there a reason why File Iterator and Position Iterator are not part of Sprit 2.x?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hartmut Kaiser</title>
		<link>http://boost-spirit.com/home/2010/01/05/stream-based-parsing-made-easy/comment-page-1/#comment-732</link>
		<dc:creator>Hartmut Kaiser</dc:creator>
		<pubDate>Tue, 05 Jan 2010 22:54:07 +0000</pubDate>
		<guid isPermaLink="false">http://boost-spirit.com/home/?p=836#comment-732</guid>
		<description>Thanks Marshall! I added this to the code above.

Regards Hartmut</description>
		<content:encoded><![CDATA[<p>Thanks Marshall! I added this to the code above.</p>
<p>Regards Hartmut</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marshall</title>
		<link>http://boost-spirit.com/home/2010/01/05/stream-based-parsing-made-easy/comment-page-1/#comment-728</link>
		<dc:creator>Marshall</dc:creator>
		<pubDate>Tue, 05 Jan 2010 21:01:57 +0000</pubDate>
		<guid isPermaLink="false">http://boost-spirit.com/home/?p=836#comment-728</guid>
		<description>Helpful bit:

#include &lt;boost/spirit/include/support_istream_iterator.hpp&gt;</description>
		<content:encoded><![CDATA[<p>Helpful bit:</p>
<p>#include &lt;boost/spirit/include/support_istream_iterator.hpp&gt;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

