Re: Design/structure X3 parser more like Qi parser

Seth <[email protected]>
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
On 19-12-16 12:25, Larry Evans wrote:
> This use of BOOST_SPIRIT_DEFINE avoids the extra compile time
> needed by make_csv_parser method above; 
I don't know how you established that there is such a compile time penalty
> hence, Seth, I'm wondering
> what the advantage of *not* using the BOOST_SPIRIT_DEFINE method
> for associating a rule with it's rule_definition?

That's not what the code does at all. It just creates a parser. You can
store it in an auto variable just like any other rule and use it. I have
little to no reason to believe the performance of the code or
compilation time would differ a lot from the equivalent using
BOOST_SPIRIT_DEFINE, but I welcome the effort to produce more
comparative benchmarks.

In case you missed it, my gist included most of that
<http://boost.2283326.n4.nabble.com/Design-structure-X3-parser-more-like-Qi-parser-tp4690205p4690394.html>.
Only the very last of 9 revisions dropped the BOOST_SPIRIT_DEFINE and
the baseline chart is from this revision:

commit 01941be830f99106f6526e2961ed79127dc92a10
Author: sehe <[email protected]>
Date:   Tue Dec 13 00:57:35 2016 +0100

    Benchmarkified with sanity_checksum

I'm sorry if I should have made it clearer the gist includes the
revision history

On 19-12-16 12:25, Larry Evans wrote:
> As the comments at the top indicate, I question (as Seth did in an
> earlier post) whether there's any advantage to this method.

My goal was to check for easy performance wins. Which I didn't find.

Along the way I refuted the notion that X3 grammar definitions would be
REQUIRED to be at namespace scope (except for the case where rules are
recursive). Again, the X3 take I gave does not pretend to replace
qi::rule, it merely shows how you can package the whole thing in a
constructor function, much like `qi::rule`'s constructor, and it's quite
elegant when you runtime-parameterize it with the delimiter.


TBH I think the performance bug is the only real issue here.

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel

_______________________________________________
Spirit-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spirit-general
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.