|
Re: Fusion-ifying proto parse trees: msg#00031parsers.spirit.devel
Eric Niebler wrote:
I've done a little perf testing of the various approaches we have for traversing parse trees. I've attached the test. Three traversals are tested. First, traverse a tree that's been pre-flattened into a fusion list. That's what Spirit-2 currently does, and is the baseline. Second, using non-segmented iterators to traverse a proto parse tree. Third, using segmented iterators. The test is run twice, first with a small number of elements (4), and next with a larger number (24). Here are the results: The test was run with VC7.1 in Release mode with aggressive inlining turned on. Short test ... Fusion list time : 5.14835e-009 Non-segmented proto time : 5.14835e-009 Segmented proto time : 6.78748e-009 Long test ... Fusion list time : 1.24216e-007 Non-segmented proto time : 7.16209e-007 Segmented proto time : 4.4167e-008 For shorter trees, the segmented implementation is a clear loser at 30% slower, and surprisingly, the non-segmented implementation does just as well as using a pre-flattened tree. For larger parse trees, the results are jaw-dropping. Segmented proto is nearly 3 TIMES FASTER than even the pre-flattened tree, and 16 times faster than non-segmented proto. I don't know what's going on, but if I had to guess, I'd say inlining depth is key to making sense of these results. By bifurcating the recursion, the total recursion depth decreases, which probably brings it under some compiler threshold. But I'm just speculating. It also suggests that a way to improve performance further is to eliminate unnecessary calls, even if you think they would normally be inlined. Also, I'm guessing that compilers with worse optimizers will make a hash of segmented proto. -- Eric Niebler Boost Consulting www.boost-consulting.com
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Fusion-ifying proto parse trees: 00031, Eric Niebler |
|---|---|
| Next by Date: | Re: Fusion-ifying proto parse trees: 00031, Joel de Guzman |
| Previous by Thread: | Re: Fusion-ifying proto parse treesi: 00031, Eric Niebler |
| Next by Thread: | Re: Fusion-ifying proto parse trees: 00031, Joel de Guzman |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |