On 10.06.2011 09:41, Stephan Witt wrote:

But metrics computation looks innocent in the profiles.


Attached the output of gprof on Linux and Mac.
On the Mac there is no timing, but on both systems
we have the number of function calls, so it gives
at least an idea which function should be reviewed.

Peter
gprof flat profile:

MAC:

  %   cumulative   self              self     total           
 time   seconds   seconds    calls  ms/call  ms/call  name    
  0.0       0.00     0.00 11815905     0.00     0.00  
__ZNK3lyx16ParagraphMetrics11singleWidthElRKNS_4FontE [44627]
  0.0       0.00     0.00  8105248     0.00     0.00  
__ZN3lyx10RowPainter9paintTextEv <cycle 10> [44628]
  0.0       0.00     0.00  7989701     0.00     0.00  
__ZNK3lyx11TextMetrics11displayFontEll [44629]
  0.0       0.00     0.00  6187215     0.00     0.00  
__ZNK3lyx11TextMetrics13rowBreakPointEill [44630]
  0.0       0.00     0.00  5529744     0.00     0.00  
__ZN3lyx6Buffer4Impl12updateMacrosERNS_11DocIteratorES3_ [44631]
  0.0       0.00     0.00  3797311     0.00     0.00  
__ZN3lyx10RowPainter10paintCharsERlRKNS_8FontInfoEbb [44632]
  0.0       0.00     0.00  3575789     0.00     0.00  
__ZN3lyx8frontend10GuiPainter4textEiiRKSbIwSt11char_traitsIwESaIwEERKNS_8FontInfoE
 [44633]
  0.0       0.00     0.00  2712365     0.00     0.00  
__ZN3lyx10RowPainter12paintFromPosERlb [44634]
  0.0       0.00     0.00  2670167     0.00     0.00  
__ZNK3lyx11TextMetrics8rowWidthEilll [44635]
  0.0       0.00     0.00  2627345     0.00     0.00  
__ZN3lyx8frontend10FontLoader7metricsERKNS_8FontInfoE [44636]
  0.0       0.00     0.00  2221481     0.00     0.00  
__ZN3lyx4Bidi13computeTablesERKNS_9ParagraphERKNS_6BufferERKNS_3RowE [44637]
  0.0       0.00     0.00  2127497     0.00     0.00  
__ZNK3lyx11TextMetrics10leftMarginEill [44638]
  0.0       0.00     0.00  1877270     0.00     0.00  
__ZNK3lyx11TextMetrics17computeRowMetricsElRNS_3RowEi [44639]
  0.0       0.00     0.00  1704868     0.00     0.00  
__ZNK3lyx4Text10isMainTextEv [44640]
  0.0       0.00     0.00  1538904     0.00     0.00  
__ZNK3lyx11DocIterator9paragraphEv [44641]
  0.0       0.00     0.00  1523285     0.00     0.00  
__ZNK3lyx9Paragraph15getFontSettingsERKNS_12BufferParamsEl [44642]
  0.0       0.00     0.00  1305402     0.00     0.00  
__ZN3lyx10RowPainter16paintForeignMarkEdPKNS_8LanguageEi [44643]
  0.0       0.00     0.00  1139412     0.00     0.00  
__ZNK3lyx9Paragraph15isWordSeparatorEl [44644]
  0.0       0.00     0.00  1032866     0.00     0.00  
__ZNK3lyx12BufferParams7getFontEv [44645]
  0.0       0.00     0.00  1002021     0.00     0.00  
__ZNK3lyx12InsetTabular7getTextEi [44646]
  0.0       0.00     0.00   959852     0.00     0.00  
__ZN3lyx11DocIterator12forwardInsetEv [44647]
  
  
Linux:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls  ms/call  ms/call  name    
  7.41      0.08     0.08  3118683     0.00     0.00  
lyx::frontend::GuiFontMetrics::width(wchar_t) const
  6.48      0.15     0.07      154     0.45     1.14  
lyx::Buffer::Impl::updateMacros(lyx::DocIterator&, lyx::DocIterator&)
  4.63      0.20     0.05  3579934     0.00     0.00  lyx::frontend::(anonymous 
namespace)::fontinfo(lyx::FontInfo const&)
  4.63      0.25     0.05   628850     0.00     0.00  
lyx::Paragraph::insetList() const
  4.17      0.30     0.05   740638     0.00     0.00  
lyx::TextMetrics::displayFont(long, long) const
  3.70      0.34     0.04   508983     0.00     0.00  
lyx::RowPainter::paintChars(long&, lyx::FontInfo const&, bool, bool)
  2.78      0.37     0.03   596815     0.00     0.00  
lyx::Paragraph::fontSpan(long) const
  2.78      0.40     0.03   244603     0.00     0.00  
lyx::DocIterator::lastpit() const
  2.78      0.43     0.03    19562     0.00     0.00  
std::_Rb_tree<std::string, std::pair<std::string const, 
std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > 
>, std::_Select1st<std::pair<std::string const, std::basic_string<wchar_t, 
std::char_traits<wchar_t>, std::allocator<wchar_t> > > >, 
std::less<std::string>, std::allocator<std::pair<std::string const, 
std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > 
> > >::find(std::string const&)
  2.78      0.46     0.03    10660     0.00     0.03  
lyx::RowPainter::paintText()
  2.31      0.48     0.03   801567     0.00     0.00  lyx::Text::isMainText() 
const
  1.85      0.50     0.02  2319515     0.00     0.00  
lyx::ParagraphMetrics::singleWidth(long, lyx::Font const&) const
  1.85      0.52     0.02  1407038     0.00     0.00  
lyx::Paragraph::getFontSettings(lyx::BufferParams const&, long) const
  1.85      0.54     0.02   515770     0.00     0.00  
lyx::frontend::GuiPainter::text(int, int, std::basic_string<wchar_t, 
std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, lyx::FontInfo 
const&)
  1.85      0.56     0.02   311312     0.00     0.00  
lyx::Tabular::cellInset(unsigned long) const
  1.85      0.58     0.02    13987     0.00     0.01  
lyx::TextMetrics::rowBreakPoint(int, long, long) const
  1.85      0.60     0.02    11457     0.00     0.00  
lyx::Bidi::computeTables(lyx::Paragraph const&, lyx::Buffer const&, lyx::Row 
const&)
  1.85      0.62     0.02     2019     0.01     0.01  
std::_Rb_tree<std::string, std::pair<std::string const, 
std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > 
>, std::_Select1st<std::pair<std::string const, std::basic_string<wchar_t, 
std::char_traits<wchar_t>, std::allocator<wchar_t> > > >, 
std::less<std::string>, std::allocator<std::pair<std::string const, 
std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > 
> > >::_M_insert_unique(std::pair<std::string const, std::basic_string<wchar_t, 
std::char_traits<wchar_t>, std::allocator<wchar_t> > > const&)
  1.85      0.64     0.02     1142     0.02     0.02  
lyx::Inset::setPosCache(lyx::PainterInfo const&, int, int) const
  1.85      0.66     0.02       40     0.50     0.50  lyx::Inset::asInsetMath() 
const
  1.85      0.68     0.02                             
lyx::frontend::GuiPainter::generateStringSignature(QString const&, 
lyx::FontInfo const&)

Reply via email to