>>>>> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes:
Abdelrazak> Abdelrazak Younes wrote: >> Jean-Marc Lasgouttes wrote: >>> This is without gcc debug STL, right? >> No but this is with MSVC STL debug which is normally quite slow. >> You're right, I should rebuild in release mode and see if things >> have improved after all the different micro-optimisations that have >> already taken place. Abdelrazak> Nope... unfortunately the MSVC-optimized version presents Abdelrazak> the exact same behaviour :-( What about this patch that I never applied (yes I know I should...)? It should give a big speedup to code that goes from inset to inset. JMarc
Index: src/dociterator.C =================================================================== --- src/dociterator.C (revision 13535) +++ src/dociterator.C (working copy) @@ -440,8 +440,29 @@ void DocIterator::forwardChar() void DocIterator::forwardInset() { forwardPos(); - while (!empty() && (pos() == lastpos() || nextInset() == 0)) + +#if 0 + DocIterator cmp(*this); +#endif + + while (!empty() && !nextInset()) { + if (inTexted()) { + pos_type const lastp = lastpos(); + Paragraph const & par = paragraph(); + pos_type & pos = top().pos(); + while (pos < lastp && !par.isInset(pos)) + ++pos; + if (pos < lastp) + break; + } forwardPos(); + } + +#if 0 + while (!cmp.empty() && (cmp.pos() == cmp.lastpos() || !cmp.nextInset())) + cmp.forwardPos(); + BOOST_ASSERT(cmp == *this); +#endif }