Boost logo

Boost :

Subject: Re: [boost] [spirit][qi] Fastest way to parse file
From: Joel de Guzman (joel_at_[hidden])
Date: 2012-02-22 23:04:03


On 2/23/12 4:15 AM, Antony Polukhin wrote:
> Hi,
>
>
>
> Boost.Spirit documentation advices to use multi_pass iterators for
> parsing files (or reading data to a STL container and then passing the
> begin and end of the container to Spirit.Qi).
>
> Much better solution would be to use a memory mapped file:
>
[snip]
>
> Comparing to multi_pass iterator, mmap approach increased parsing
> speed more than 5 times, reduced memory usage and CPU load.
>
> Mmap approach is also a little bit faster than reading data to STL
> container and mmap sometimes requires less memory (depending on OS).
>
>
>
> I think, that such solution should be at least mentioned in Spirit
> documentation.

Agreed!

> May be mmap shall be wrapped in some class for tighter integration
> with Spirit and simpler usage:
>
[snip]
>

Thanks for posting. If you don't mind tweaking your text for publication,
I'd gladly post this as an article in Spirit's site. This should be
a good addition to the doc addendum page.

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://boost-spirit.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk