https://bugs.freedesktop.org/show_bug.cgi?id=81272

--- Comment #7 from Matthew Francis <[email protected]> ---
For a paragraph with N continuous characters of Chinese text (e.g. N x "δΈ­"),
iterating over the paragraph with SwScanner will cause
xdictionary::getWordBoundary() to be called N times, each of which will call
xdictionary::seekSegment(), which will in turn iterate over each of the N
characters

-> N^2 operations

This needs refactoring so seekSegment() doesn't keep doing the same work over
and over again



For Chinese text, the path through from SwScanner to xdictionary goes like
this:

    frame #1: 0x0000000110919243
libi18npoollo.dylib`com::sun::star::i18n::xdictionary::seekSegment(this=0x000000010c08a000,
rText=0x00007fff5fbfa930, pos=1, segBoundary=0x000000010c08a028) + 115 at
xdictionary.cxx:280
    frame #2: 0x00000001109199dd
libi18npoollo.dylib`com::sun::star::i18n::xdictionary::getWordBoundary(this=0x000000010c08a000,
rText=0x00007fff5fbfa930, anyPos=1, wordType=3, bDirection=true) + 173 at
xdictionary.cxx:412
    frame #3: 0x00000001109073e7
libi18npoollo.dylib`com::sun::star::i18n::BreakIterator_CJK::getWordBoundary(this=0x000000011ff93ab8,
text=0x00007fff5fbfa930, anyPos=1, nLocale=0x00000001206d7600, wordType=3,
bDirection='\x01') + 119 at breakiterator_cjk.cxx:81
    frame #4: 0x000000011090753c libi18npoollo.dylib`non-virtual thunk to
com::sun::star::i18n::BreakIterator_CJK::getWordBoundary(this=0x000000011ff93ae0,
text=0x00007fff5fbfa930, anyPos=1, nLocale=0x00000001206d7600, wordType=3,
bDirection='\x01') + 92 at breakiterator_cjk.cxx:88
    frame #5: 0x000000011090e0e4
libi18npoollo.dylib`com::sun::star::i18n::BreakIteratorImpl::getWordBoundary(this=0x0000000117072b78,
Text=0x00007fff5fbfa930, nPos=1, rLocale=0x00000001206d7600, rWordType=3,
bDirection='\x01') + 612 at breakiteratorImpl.cxx:182
    frame #6: 0x000000011090e1dc libi18npoollo.dylib`non-virtual thunk to
com::sun::star::i18n::BreakIteratorImpl::getWordBoundary(this=0x0000000117072ba0,
Text=0x00007fff5fbfa930, nPos=1, rLocale=0x00000001206d7600, rWordType=3,
bDirection='\x01') + 92 at breakiteratorImpl.cxx:186
    frame #7: 0x00000001184e85d0
libswlo.dylib`SwScanner::NextWord(this=0x00007fff5fbfa918) + 1296 at
txtedt.cxx:836

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to