To reproduce:
  1) Open a complex lyx file with many math insets, macros etc. (e.g.
http://www.csse.uwa.edu.au/~john/drafts/Thesis_Background.lyx, or just
create a new document and fill the screen with "$x$ x", where $x$
represents math-mode x)
  2) Hold down X (or any other normal key) for a few seconds.
  3) Note that LyX cannot keep up with typematic rate, so X's will
continue to appear a couple of seconds after release key.

I cannot reproduce with 1.6.4svn (though filling the screen with "$x$
x" is still quite slow, even in 1.6).

I am using:
 Intel(R) Pentium(R) 4 CPU 3.20GHz
 Intel Corporation 82945G/GZ Integrated Graphics Controller (rev 02)
 qt 4.5.0
 2.1.0svn (r38828)

I have put some information below. It doesn't make much sense to me.
Does it make sense to anyone else?

PCT (or sysprof for that matter) didn't identify a single large cost.
The largest use of CPU time was pthread at ~10%, according to PCT. The
largest in LyX was updateMacros (only 1.7%, but why do we have to
update macros?).

I interrupted LyX while it was busy catching up with the 'x's three
times. Each time the backtrace looked like:

(gdb) bt
#0  0xffffe424 in __kernel_vsyscall ()
#1  0x4b9fe39d in ___newselect_nocancel () from /lib/libc.so.6
#2  0x41e4c2a5 in ?? () from /usr/lib/libxcb.so.1
#3  0x41e4d94f in xcb_wait_for_event () from /usr/lib/libxcb.so.1
#4  0x41d848a1 in ?? () from /usr/lib/libX11.so.6
#5  0x41d84c10 in ?? () from /usr/lib/libX11.so.6
#6  0x41d853d7 in _XReadEvents () from /usr/lib/libX11.so.6
#7  0x41d632eb in XIfEvent () from /usr/lib/libX11.so.6
#8  0x41db23ca in ?? () from /usr/lib/libX11.so.6
#9  0x41db14c4 in ?? () from /usr/lib/libX11.so.6
#10 0x41db1887 in _XimRead () from /usr/lib/libX11.so.6
#11 0x41da33bc in ?? () from /usr/lib/libX11.so.6
#12 0x41d9cf1a in ?? () from /usr/lib/libX11.so.6
#13 0x41d5cab2 in XFilterEvent () from /usr/lib/libX11.so.6
#14 0x434d9117 in ?? () from /usr/lib/libQtGui.so.4
#15 0xb7309b42 in QString::free ()
   from /usr/lib/qt4/plugins/inputmethods/libqimsw-multi.so
#16 0x42f24520 in QApplication::x11ProcessEvent () from /usr/lib/libQtGui.so.4
#17 0x42f4ef6a in ?? () from /usr/lib/libQtGui.so.4
#18 0x41ecb258 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#19 0x41ece903 in ?? () from /lib/libglib-2.0.so.0
#20 0x41eceac1 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#21 0x42cb8188 in QEventDispatcherGlib::processEvents ()
---Type <return> to continue, or q <return> to quit---
   from /usr/lib/libQtCore.so.4
#22 0x42f4e665 in ?? () from /usr/lib/libQtGui.so.4
#23 0x42c8ad8a in QEventLoop::processEvents () from /usr/lib/libQtCore.so.4
#24 0x42c8b1ca in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#25 0x42c8d679 in QCoreApplication::exec () from /usr/lib/libQtCore.so.4
#26 0x42eaeb67 in QApplication::exec () from /usr/lib/libQtGui.so.4
#27 0x08226567 in lyx::LyX::exec (this=0xbfffee90, argc=@0xbfffeec0,
    argv=0xbfffef44) at LyX.cpp:395
#28 0x08076ac0 in main (argc=2, argv=0x0) at main.cpp:42


-----------

Output from PCT:

...
 0.4%   /lib/libpthread-2.9.so:000090c9
 0.4%   /usr/lib/libaspell.so.15.1.4:00046be2
 0.4%   /usr/lib/libaspell.so.15.1.4:00046c23
 0.4%   /usr/lib/libaspell.so.15.1.4:00046c43
 0.4%   /usr/lib/libstdc++.so.6.0.10:0004d94d
 0.4%   /usr/lib/libaspell.so.15.1.4:0005bab5
 0.4%   /home/local/john/src/lyx-devel/src/lyx:bool
__gnu_debug::operator==<__gnu_cxx::__normal_iterator<lyx::InsetList::InsetTable
const*, std::__norm::vector<lyx::InsetList::InsetTable,
std::allocator<lyx::InsetList::InsetTable> > >,
__gnu_cxx::__normal_iterator<lyx::InsetList::InsetTable*,
std::__norm::vector<lyx::InsetList::InsetTable,
std::allocator<lyx::InsetList::InsetTable> > >,
std::__debug::vector<lyx::InsetList::InsetTable,
std::allocator<lyx::InsetList::InsetTable> >
>(__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<lyx::InsetList::InsetTable
const*, std::__norm::vector<lyx::InsetList::InsetTable,
std::allocator<lyx::InsetList::InsetTable> > >,
std::__debug::vector<lyx::InsetList::InsetTable,
std::allocator<lyx::InsetList::InsetTable> > > const&,
__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<lyx::InsetList::InsetTable*,
std::__norm::vector<lyx::InsetList::InsetTable,
std::allocator<lyx::InsetList::InsetTable> > >,
std::__debug::vector<lyx::InsetList::InsetTable,
std::allocator<lyx::InsetList::InsetTable> > > const&)
 0.4%   /lib/libc-2.9.so:000f303b
 0.4%   /usr/lib/libaspell.so.15.1.4:0005baa3
 0.4%   /usr/lib/libaspell.so.15.1.4:00046c35
 0.4%   /usr/lib/libaspell.so.15.1.4:00046bd3
 0.4%   /usr/lib/libaspell.so.15.1.4:00046be5
 0.4%   /usr/lib/libaspell.so.15.1.4:0005bab2
 0.5%   /home/local/john/src/lyx-devel/src/lyx:std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t>
>::operator[](unsigned int)
 0.5%   /lib/libpthread-2.9.so:00004230
 0.5%   /lib/libpthread-2.9.so:0000907c
 0.5%   /usr/lib/libaspell.so.15.1.4:00046c30
 0.5%   /usr/lib/libaspell.so.15.1.4:0006cfdd
 0.5%   /usr/lib/libstdc++.so.6.0.10:0004d957
 0.5%   /usr/lib/libaspell.so.15.1.4:00046be0
 0.5%   /usr/lib/libstdc++.so.6.0.10:0004d940
 0.5%   /usr/lib/libaspell.so.15.1.4:00046bf3
 0.5%   /usr/lib/libaspell.so.15.1.4:00046c32
 0.6%   /lib/libpthread-2.9.so:000079ee
 0.6%   /usr/lib/libaspell.so.15.1.4:0005babb
 0.6%   /usr/lib/libstdc++.so.6.0.10:000b3d5d
 0.6%   /usr/lib/libstdc++.so.6.0.10:0004d948
 0.6%   /lib/libc-2.9.so:00016522
 0.6%   /usr/lib/libaspell.so.15.1.4:0005bab0
 0.7%   /home/local/john/src/lyx-devel/src/lyx:_init
 0.7%   /usr/lib/libaspell.so.15.1.4:00046d33
 1.4%   /usr/lib/libstdc++.so.6.0.10:0004d95a
 1.7%   
/home/local/john/src/lyx-devel/src/lyx:lyx::Buffer::Impl::updateMacros(lyx::DocIterator&,
lyx::DocIterator&)
 9.0%   /lib/libpthread-2.9.so:000090e6
11.6%   /lib/libpthread-2.9.so:00007a4c

I noticed that aspell was using some time, so I disabled continuous
spellchecking. I could still reproduce and the output from PCT became:

...
 0.4%   /home/local/john/src/lyx-devel/src/lyx:std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::compare(char const*)
const
 0.5%   /lib/libpthread-2.9.so:00004230
 0.5%   /lib/libpthread-2.9.so:00004233
 0.5%   /lib/libpthread-2.9.so:000079ee
 0.5%   /usr/lib/libstdc++.so.6.0.10:0004242a
 0.5%   /lib/libc-2.9.so:00016522
 0.5%   /lib/libc-2.9.so:000f303b
 0.5%   /usr/lib/libX11.so.6.2.0:000212a4
 0.5%   /usr/lib/libstdc++.so.6.0.10:0004d948
 0.5%   /usr/lib/libstdc++.so.6.0.10:0004d957
 0.6%   /home/local/john/src/lyx-devel/src/lyx:_init
 0.6%   /lib/libpthread-2.9.so:0000907c
 0.8%   /usr/lib/libstdc++.so.6.0.10:0004d940
 0.8%   /usr/lib/libstdc++.so.6.0.10:000b3d5d
 1.5%   /usr/lib/libstdc++.so.6.0.10:0004d95a
 1.7%   
/home/local/john/src/lyx-devel/src/lyx:lyx::Buffer::Impl::updateMacros(lyx::DocIterator&,
lyx::DocIterator&)
10.1%   /lib/libpthread-2.9.so:000090e6
12.3%   /lib/libpthread-2.9.so:00007a4c


-- 
John C. McCabe-Dansted

Reply via email to