|
Boost Users : |
Subject: Re: [Boost-users] Simple fast parsing
From: Alan M. Carroll (amc_at_[hidden])
Date: 2009-06-22 10:21:34
At 05:49 PM 6/21/2009, you wrote:
>Christopher Jefferson wrote:
>
>>Looking at the documentation, Boost::Spirit seems like a very big hammer to crack this quite small nut, and it is unclear to me how well it would fit into an existing recursive decent parser. Has anyone ever used it as such? Is there a simple alternative?
>
>Spirit is well tuned for small parsing tasks like this. It is a
>modular RD parser. What you need is what you pay for. The code is
>as tight as it can be.
I don't think this solves his problem. Note that he got a 10X speed up by changing to a buffer with his existing parser, so the _parsing_ code isn't the bottle neck. It's better I/O that's needed. I suspect it's the locking done by streams on each operation, so he's basically doing a lock on every character. I think he'd be better off using the forward iterator idea and then either writing a small wrapper class on streams to block read or use the lower level read buffer interface.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net