Angus Leeming wrote:

> Angus Leeming wrote:
>> $ ../configure \
>> --enable-profiling \
>> --disable-assertions \
>> --disable-stdlib-debug \
>> --enable-optimization=-O2 \
>> --with-frontend='qt' --with-qt-includes='/usr/include/qt3' \
>> LDFLAGS='-Wl,-t'
> 
> OK, Jean-Marc, Georg.
> The thing took over an hour to link but it works. I fired up LyX,
> opened up an old document and typed garbage in the first paragraph
> faster than LyX could keep up. Then I quit LyX.
> 
> You can find the resulting output of
>   $ gprof ./lyx-qt > profile.txt
> here:
>   http://www.lyx.org/~leeming/profile.txt.bz2
> (209kB expanding to 4.1MB)
> 
> Does it help any?
> 
> Angus
> 
> ps, this is pristine CVS. I haven't tried out Martin's patches. I'm
> perfectly happy to do so, but would like someone to take me through
> the output first :)

Attached are edited highlights from this profiling. There would appear
to be lots of scope for improvement :)

Assuming that I'm editing the right bit of the profile log of
course...

-- 
Angus
index % time    self  children    called     name
[1]     75.5    0.00    1.01     153+506     <cycle 1 as a whole> [1]
                0.00    0.94      74             BufferView::Pimpl::update(Update::flags) <cycle 1> [2]
                0.00    0.05       2             BufferView::Pimpl::setBuffer(Buffer*) <cycle 1> [73]
[2]     70.5    0.00    0.94      74         BufferView::Pimpl::update(Update::flags) <cycle 1> [2]
                0.00    0.59      72/72          BufferView::Pimpl::metrics(bool) [6]
                0.00    0.28      39/39          LyXScreen::redraw(BufferView&, ViewMetricsInfo const&) [21]
                0.00    0.04      72/72          Buffer::buildMacros() [80]
-----------------------------------------------
[3]     53.0    0.01    0.70     869         LyXText::redoParagraph(long) [3]
                0.00    0.27    1248/1248        MathHullInset::metrics(MetricsInfo&, Dimension&) const [27]
                0.00    0.20     476/476         MathMacroTemplate::metrics(MetricsInfo&, Dimension&) const [33]
                0.02    0.07    2561/2561        LyXText::rowBreakPoint(long, Row&) const [59]
                0.01    0.06    2561/2561        LyXText::setRowWidth(long, Row&) const [66]
                0.01    0.05    2561/2561        LyXText::setHeightOfRow(long, Row&) [71]
                0.00    0.01    1724/8045        LyXText::leftMargin(long, long) const [89]
-----------------------------------------------
[4]     46.4    0.00    0.62      34         LyXFunc::dispatch(FuncRequest const&) [4]
                0.00    0.26      32/34          LCursor::dispatch(FuncRequest const&) [23]
                0.00    0.22      33/65          BufferView::update(Update::flags) [17]
                0.00    0.13       1/1           LyXFunc::open(std::string const&) [40]
                0.00    0.01       1/1           QuitLyX(bool) [208]
                0.00    0.01      32/32          Buffer::markDirty() [261]
-----------------------------------------------
[5]     46.2    0.00    0.62                 QContentPane::qt_invoke(int, QUObject*) [5]
                0.00    0.59    1077/1077        QContentPane::keyeventTimeout() [7]
                0.00    0.03       8/8           QContentPane::scrollBarChanged(int) [109]
-----------------------------------------------
                0.00    0.59      72/72          BufferView::Pimpl::update(Update::flags) <cycle 1> [2]
[6]     44.4    0.00    0.59      72         BufferView::Pimpl::metrics(bool) [6]
                0.00    0.59     725/869         LyXText::redoParagraph(long) [3]
-----------------------------------------------
[7]     44.0    0.00    0.59    1077         QContentPane::keyeventTimeout() [7]
                0.00    0.59      32/32          boost::signal2<void, boost::shared_ptr<LyXKeySym>, key_modifier::state, boost::last_value<void>, int, std::less<int>, boost::function<void ()(boost::shared_ptr<LyXKeySym>, key_modifier::state), std::allocator<void> > >::operator()(boost::shared_ptr<LyXKeySym>, key_modifier::state) [8]
id>, int, std::less<int>, boost::function<void ()(boost::shared_ptr<LyXKeySym>, key_modifier::state), std::allocator<void> > >::operator()(boost::shared_ptr<LyXKeySym>, key_modifier::state) [8]
                0.00    0.59      32/32          boost::detail::postfix_increment_result<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound2<void>::caller<boost::shared_ptr<LyXKeySym>, key_modifier::state, boost::function<void ()(boost::shared_ptr<LyXKeySym>, key_modifier::state), std::allocator<void> > >, boost::signals::detail::named_slot_map_iterator>, boost::signals::detail::unusable, boost::signals::detail::unusable const&, boost::single_pass_traversal_tag>::type boost::operator++<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound2<void>::caller<boost::shared_ptr<LyXKeySym>, key_modifier::state, boost::function<void ()(boost::shared_ptr<LyXKeySym>, key_modifier::state), std::allocator<void> > >, boost::signals::detail::named_slot_map_iterator>, boost::signals::detail::unusable, boost::single_pass_traversal_tag, boost::signals::detail::unusable const&, long>(boost::iterator_facade<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound2<void>::caller<boost::shared_ptr<LyXKeySym>, key_modifier::state, boost::function<void ()(boost::shared_ptr<LyXKeySym>, key_modifier::state), std::allocator<void> > >, boost::signals::detail::named_slot_map_iterator>, boost::signals::detail::unusable, boost::single_pass_traversal_tag, boost::signals::detail::unusable const&, long>&, int) [9]
-----------------------------------------------
[8]     43.9    0.00    0.59      32         boost::signal2<void, boost::shared_ptr<LyXKeySym>, key_modifier::state, boost::last_value<void>, int, std::less<int>, boost::function<void ()(boost::shared_ptr<LyXKeySym>, key_modifier::state), std::allocator<void> > >::operator()(boost::shared_ptr<LyXKeySym>, key_modifier::state) [8]
                0.00    0.59      32/32          boost::detail::postfix_increment_result<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound2<void>::caller<boost::shared_ptr<LyXKeySym>, key_modifier::state, boost::function<void ()(boost::shared_ptr<LyXKeySym>, key_modifier::state), std::allocator<void> > >, boost::signals::detail::named_slot_map_iterator>, boost::signals::detail::unusable, boost::signals::detail::unusable const&, boost::single_pass_traversal_tag>::type boost::operator++<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound2<void>::caller<boost::shared_ptr<LyXKeySym>, key_modifier::state, boost::function<void ()(boost::shared_ptr<LyXKeySym>, key_modifier::state), std::allocator<void> > >, boost::signals::detail::named_slot_map_iterator>, boost::signals::detail::unusable, boost::single_pass_traversal_tag, boost::signals::detail::unusable const&, long>(boost::iterator_facade<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound2<void>::caller<boost::shared_ptr<LyXKeySym>, key_modifier::state, boost::function<void ()(boost::shared_ptr<LyXKeySym>, key_modifier::state), std::allocator<void> > >, boost::signals::detail::named_slot_map_iterator>, boost::signals::detail::unusable, boost::single_pass_traversal_tag, boost::signals::detail::unusable const&, long>&, int) [9]
-----------------------------------------------
[9]     43.8    0.00    0.59      32         boost::detail::postfix_increment_result<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound2<void>::caller<boost::shared_ptr<LyXKeySym>, key_modifier::state, boost::function<void ()(boost::shared_ptr<LyXKeySym>, key_modifier::state), std::allocator<void> > >, boost::signals::detail::named_slot_map_iterator>, boost::signals::detail::unusable, boost::signals::detail::unusable const&, boost::single_pass_traversal_tag>::type boost::operator++<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound2<void>::caller<boost::shared_ptr<LyXKeySym>, key_modifier::state, boost::function<void ()(boost::shared_ptr<LyXKeySym>, key_modifier::state), std::allocator<void> > >, boost::signals::detail::named_slot_map_iterator>, boost::signals::detail::unusable, boost::single_pass_traversal_tag, boost::signals::detail::unusable const&, long>(boost::iterator_facade<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound2<void>::caller<boost::shared_ptr<LyXKeySym>, key_modifier::state, boost::function<void ()(boost::shared_ptr<LyXKeySym>, key_modifier::state), std::allocator<void> > >, boost::signals::detail::named_slot_map_iterator>, boost::signals::detail::unusable, boost::single_pass_traversal_tag, boost::signals::detail::unusable const&, long>&, int) [9]
                0.00    0.59      32/32          boost::function2<void, boost::shared_ptr<LyXKeySym>, key_modifier::state, std::allocator<void> >::operator()(boost::shared_ptr<LyXKeySym>, key_modifier::state) const [12]
-----------------------------------------------
[10]    43.8    0.00    0.59      32         BufferView::Pimpl::workAreaKeyPress(boost::shared_ptr<LyXKeySym>, key_modifier::state) [10]
                0.00    0.58      32/32          LyXFunc::processKeySym(boost::shared_ptr<LyXKeySym>, key_modifier::state) [13]
-----------------------------------------------
[11]    43.8    0.00    0.59      32         boost::detail::function::void_function_obj_invoker2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, BufferView::Pimpl, boost::shared_ptr<LyXKeySym>, key_modifier::state>, boost::_bi::list3<boost::_bi::value<BufferView::Pimpl*>, boost::arg<1>, boost::arg<2> > >, void, boost::shared_ptr<LyXKeySym>, key_modifier::state>::invoke(boost::detail::function::any_pointer, boost::shared_ptr<LyXKeySym>, key_modifier::state) [11]
                0.00    0.59      32/32          BufferView::Pimpl::workAreaKeyPress(boost::shared_ptr<LyXKeySym>, key_modifier::state) [10]
-----------------------------------------------
[12]    43.8    0.00    0.59      32         boost::function2<void, boost::shared_ptr<LyXKeySym>, key_modifier::state, std::allocator<void> >::operator()(boost::shared_ptr<LyXKeySym>, key_modifier::state) const [12]
                0.00    0.59      32/32          boost::detail::function::void_function_obj_invoker2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, BufferView::Pimpl, boost::shared_ptr<LyXKeySym>, key_modifier::state>, boost::_bi::list3<boost::_bi::value<BufferView::Pimpl*>, boost::arg<1>, boost::arg<2> > >, void, boost::shared_ptr<LyXKeySym>, key_modifier::state>::invoke(boost::detail::function::any_pointer, boost::shared_ptr<LyXKeySym>, key_modifier::state) [11]
-----------------------------------------------
[13]    43.7    0.00    0.58      32         LyXFunc::processKeySym(boost::shared_ptr<LyXKeySym>, key_modifier::state) [13]
                0.00    0.58      32/34          LyXFunc::dispatch(FuncRequest const&) [4]

-----------------------------------------------

 This table describes the call tree of the program, and was sorted by
 the total amount of time spent in each function and its children.

 Each entry in this table consists of several lines.  The line with the
 index number at the left hand margin lists the current function.
 The lines above it list the functions that called this function,
 and the lines below it list the functions this one called.
 This line lists:
     index	A unique number given to each element of the table.
		Index numbers are sorted numerically.
		The index number is printed next to every function name so
		it is easier to look up where the function in the table.

     % time	This is the percentage of the `total' time that was spent
		in this function and its children.  Note that due to
		different viewpoints, functions excluded by options, etc,
		these numbers will NOT add up to 100%.

     self	This is the total amount of time spent in this function.

     children	This is the total amount of time propagated into this
		function by its children.

     called	This is the number of times the function was called.
		If the function called itself recursively, the number
		only includes non-recursive calls, and is followed by
		a `+' and the number of recursive calls.

     name	The name of the current function.  The index number is
		printed after it.  If the function is a member of a
		cycle, the cycle number is printed between the
		function's name and the index number.


 For the function's parents, the fields have the following meanings:

     self	This is the amount of time that was propagated directly
		from the function into this parent.

     children	This is the amount of time that was propagated from
		the function's children into this parent.

     called	This is the number of times this parent called the
		function `/' the total number of times the function
		was called.  Recursive calls to the function are not
		included in the number after the `/'.

     name	This is the name of the parent.  The parent's index
		number is printed after it.  If the parent is a
		member of a cycle, the cycle number is printed between
		the name and the index number.

 If the parents of the function cannot be determined, the word
 `<spontaneous>' is printed in the `name' field, and all the other
 fields are blank.

 For the function's children, the fields have the following meanings:

     self	This is the amount of time that was propagated directly
		from the child into the function.

     children	This is the amount of time that was propagated from the
		child's children to the function.

     called	This is the number of times the function called
		this child `/' the total number of times the child
		was called.  Recursive calls by the child are not
		listed in the number after the `/'.

     name	This is the name of the child.  The child's index
		number is printed after it.  If the child is a
		member of a cycle, the cycle number is printed
		between the name and the index number.

 If there are any cycles (circles) in the call graph, there is an
 entry for the cycle-as-a-whole.  This entry shows who called the
 cycle (as parents) and the members of the cycle (as children.)
 The `+' recursive calls entry shows the number of function calls that
 were internal to the cycle, and the calls entry for each member shows,
 for that member, how many times it was called from other members of
 the cycle.

Reply via email to