logo       

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

parsers.spirit.devel

Subject: Re: Fusion-ifying proto parse trees

Eric Niebler wrote:
Joel de Guzman wrote:
David Abrahams wrote:
"Eric Niebler" <eric@xxxxxxxxxxxxxxxxxxxx> writes:

Every time you increment a joint view iterator, you're checking to see
if you've reached the end of the first sequence, so you know when to
start the second. And if Iterator::first_type is itself a joint view
iterator, it *also* must check to see if it's at the end of *its*
first sequence to know if it should start its second. And so on. If
you do a bunch of push_backs and end up with a joint_view of a
joint_view of a joint_view, iterating it will be far from
trivial. This sort of flattening-on-the-fly is *exactly* the problem
that non-segmented proto has, and is the problem that segmented
iterators solve.

Just to be clear, this is all compile-time cost. There's no reason
*that* has to be slow at runtime.

Definitely. But I think I see Eric's point. Anyway, that's easy enough
to test. I still have some reservations with the Zero-copy expression
template construction because in my experience holding references
in many cases actually slow things down compared to holding just
the values, especially for trivial elements like chars.


You're right. Simple things like chars don't need to be held by reference. Instead of always storing an Arg& we can store a call_traits<Arg>::param_type. Thanks.

Well, so do unary (or even binary) holders that hold trivial
items (like chars). So, actually, it is still cheap to hold a
unary(unary(unary(unary....(char)))). Then, there's also the
added indirection when you refer to the children. So instead
of having the compiler optimize, you go through the reference(s).
Maybe you can incorporate some kind of heuristics to detect
"cheap" copy objects. Perhaps sizeof will do?

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