|
Re: Fusion-ifying proto parse trees: msg#00037parsers.spirit.devel
Eric Niebler wrote: Joel de Guzman wrote: It's not beating the pre-flattened lists in my tests: /////////////////////////////////// VC7.1 Short test ... 80 80 80 Fusion list time : 4.07547e-009 Non-segmented proto time : 4.65661e-009 Segmented proto time : 4.77582e-009 Long test ... 480 480 480 Fusion list time : 9.67979e-008 Non-segmented proto time : 6.40869e-007 Segmented proto time : 3.17097e-008 Proto still lags badly with gcc: And ditto for VC8.0, but not much: /////////////////////////////////// VC8.0 Short test ... 80 80 80 Fusion list time : 4.5374e-009 Non-segmented proto time : 4.54485e-009 Segmented proto time : 5.93811e-009 Long test ... 480 480 480 Fusion list time : 2.18749e-008 Non-segmented proto time : 6.10352e-007 Segmented proto time : 3.1203e-008 The reason I used a list in the test is because that's what Spirit-2 was using. Would you really consider switching to vector, which would place limits on the number of nodes in a sequence? No, I wouldn't use a vector. Spirit pre-2 did use vectors but I had problems with large trees. One plausible strategy though is to use vectors on small trees and switch to lists on larger ones. Ah the joys of multi-container types! Also, these tests leave out one detail ... the cost of building the expression template. Is building an unflattened proto parse tree more or less expensive than flattening into a list/vector eagerly? We should really be taking that into account. The cost of building the ET would probably dominate. I think it would be the same, but I am guessing. I am basing that guess from the code size generated from proto and the pre-proto code, which more or less amounts to the same footprint. Regarding your question about taking the minimum result, I lifted this code from John Maddock's regex performance shoot-out. This is how he collects his timing. Yes, this is a black art -- I don't really understand it. I recall Dave A mention some benchmarking strategies that take off the unwanted effects. I'm still looking for the links. You can see in the VC8.0 tests that fusion list is winning. My guess is that this is a problem with VC7.1's optimizer that gives fusion lists a great disadvantage. My guess is that if that effect is known and isolated, fusion lists can be optimized for VC7.1 to mitigate this effect. I believe that what we are seeing is an effect; not really due to the raw-algorithmic advantage of segmentation. IOTW, I think you were just lucky to have found a good formulation for 7.1 and for 7.1 alone. Cheers, -- 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> |
|---|---|---|
| Previous by Date: | Re: Fusion-ifying proto parse trees: 00037, Eric Niebler |
|---|---|
| Next by Date: | RE: Re: Fusion-ifying proto parse trees: 00037, Hartmut Kaiser |
| Previous by Thread: | Re: Fusion-ifying proto parse treesi: 00037, Eric Niebler |
| Next by Thread: | RE: Re: Fusion-ifying proto parse trees: 00037, Hartmut Kaiser |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |