logo       

Re: Fusion-ifying proto parse trees: msg#00065

parsers.spirit.devel

Subject: Re: Fusion-ifying proto parse trees

Eric Niebler wrote:

Joel de Guzman wrote:

Ok, let's put your hypothesis to test. Can we try your
Zero-copy expression template construction idea with the
current tests that you have? (i.e. seq<> holding its left
and right children by reference).


The results are in. The following ET schemes were tested:

1) The Spirit2 approach: eager flattening in the ET
2) Non-segmented proto: Zero-copy ET construction, non-segmented ET traversal.
3) Segmented proto: Zero-copy ET construction, segmented ET traversal.

Time taken to construct the ET and traverse it was measured. The winner by a wide margin is (3) segmented proto. For larger ET trees, segmented proto is over 8x faster than the Spirit2 approach. (Note that even non-segmented proto is marginally faster than the Spirit2 approach.)

I have also reformulated the segmentation interface according to the simpler scheme Joel and I discussed. It's *much* easier to work with.

For kicks, I also ran the test with proto modified to hold copies of its child nodes instead of references, on the chance that the cost of the indirections might outweigh the cost of the copies. It doesn't. Holding children by value is 2x slower than holding them by reference. (The indirections do have a cost, however, so if you plan to traverse the proto tree multiple times, it might make sense to deep-copy it first. Proto should provide a deep-copy utility.)

Attached is the test and the timing results. Be sure to sync to $boost_root/boost/xpressive, as I had to make changes to proto to support zero-copy ET construction.

Great! It would be nice if the 1) time taken to construct the ET
and 2) the time to traverse it, are reported separately. For spirit,
while 1 is important, 2 is more important by a wide margin. It's
a balance, I can tolerate a few clock cycles for 1 if that would
improve 2. So, it's very important to see both timings.

It would also be nice to see the App footprint, but I guess it's
too early to do that now.

Regards,
--
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise