Michael Gerz wrote:
Edwin,

could you please check whether the attached patch saves any time in lyx::Changes::lookup(int) const and lyx::Changes::merge() during opening/saving a file?

this is open (save below):

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
7.41 0.02 0.02 268500 0.00 0.00 lyx::InsetBase::inMathed() const 7.41 0.04 0.02 10948 0.00 0.00 lyx::support::compare_no_case(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&) 3.70 0.05 0.01 236382 0.00 0.00 lyx::operator==(lyx::LyXKeySym const&, lyx::LyXKeySym const&) 3.70 0.06 0.01 191783 0.00 0.00 lyx::DocIterator::inTexted() const 3.70 0.07 0.01 182929 0.00 0.00 lyx::operator==(lyx::LyXFont::FontBits const&, lyx::LyXFont::FontBits const&) 3.70 0.08 0.01 181982 0.00 0.00 lyx::Paragraph::Pimpl::insertChar(int, wchar_t, lyx::Change const&) 3.70 0.09 0.01 180583 0.00 0.00 lyx::Paragraph::insertChar(int, wchar_t, lyx::LyXFont const&, lyx::Change const&) 3.70 0.10 0.01 151794 0.00 0.00 lyx::InsetText::getText(int) const 3.70 0.11 0.01 116494 0.00 0.00 lyx::DocIterator::inMathed() const 3.70 0.12 0.01 64695 0.00 0.00 lyx::DocIterator::lastpos() const 3.70 0.13 0.01 54501 0.00 0.00 lyx::CursorSlice::paragraph() const 3.70 0.14 0.01 46416 0.00 0.00 lyx::DocIterator::paragraph() 3.70 0.15 0.01 33274 0.00 0.00 lyx::InsetTabular::cell(unsigned int) const 3.70 0.16 0.01 18226 0.00 0.00 lyx::LyXLex::Pimpl::next(bool) 3.70 0.17 0.01 9203 0.00 0.00 lyx::InsetBase::nargs() const 3.70 0.18 0.01 8752 0.00 0.00 lyx::MenuItem::~MenuItem() 3.70 0.19 0.01 6936 0.00 0.00 std::vector<char, std::allocator<char> > lyx::(anonymous namespace)::iconv_convert<char, wchar_t>(lyx::IconvProcessor&, wchar_t const*, unsigned int) 3.70 0.20 0.01 1936 0.01 0.01 boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_start_line() 3.70 0.21 0.01 1329 0.01 0.01 std::_Rb_tree<std::string, std::pair<std::string const, lyx::kb_action>, std::_Select1st<std::pair<std::string const, lyx::kb_action> >, std::less<std::string>, std::allocator<std::pair<std::string const, lyx::kb_action> > >::find(std::string const&) const 3.70 0.22 0.01 936 0.01 0.01 boost::signal2<void, std::string const&, lyx::InsetBase*, boost::last_value<void>, int, std::less<int>, boost::function<void ()(std::string const&, lyx::InsetBase*), std::allocator<void> > >::operator()(std::string const&, lyx::InsetBase*) 3.70 0.23 0.01 439 0.02 0.02 lyx::(anonymous namespace)::Parser::skipSpaceTokens(std::basic_istream<wchar_t, std::char_traits<wchar_t> >&, wchar_t) 3.70 0.24 0.01 18 0.56 0.56 lyx::LyXTabular::read(lyx::Buffer const&, lyx::LyXLex&) 3.70 0.25 0.01 10 1.00 1.55 lyx::InsetFloat::addToToc(lyx::TocList&, lyx::Buffer const&) const 3.70 0.26 0.01 2 5.00 27.94 lyx::TocBackend::update() 3.70 0.27 0.01 1 10.00 40.27 lyx::Buffer::updateBibfilesCache() 0.00 0.27 0.00 205702 0.00 0.00 char lyx::support::(anonymous namespace)::ascii_tolower<char>(char) 0.00 0.27 0.00 184108 0.00 0.00 lyx::Paragraph::setFont(int, lyx::LyXFont const&) 0.00 0.27 0.00 183891 0.00 0.00 lyx::Changes::set(lyx::Change const&, int, int)
  0.00      0.27     0.00   183891     0.00     0.00  lyx::Changes::merge()
0.00 0.27 0.00 181982 0.00 0.00 lyx::Changes::insert(lyx::Change const&, int)



and this save:




Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
17.07 0.21 0.21 15272 0.01 0.06 lyx::Paragraph::write(lyx::Buffer const&, std::ostream&, lyx::BufferParams const&, unsigned int&) const 9.76 0.33 0.12 1456198 0.00 0.00 lyx::Paragraph::getFontSettings(lyx::BufferParams const&, int) const 8.94 0.44 0.11 1427808 0.00 0.00 std::vector<char, std::allocator<char> >::_M_insert_aux(__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, char const&) 7.32 0.53 0.09 1437719 0.00 0.00 std::vector<char, std::allocator<char> > lyx::(anonymous namespace)::iconv_convert<char, wchar_t>(lyx::IconvProcessor&, wchar_t const*, unsigned int) 5.69 0.60 0.07 1638988 0.00 0.00 lyx::operator==(lyx::LyXFont::FontBits const&, lyx::LyXFont::FontBits const&) 4.07 0.65 0.05 1471128 0.00 0.00 lyx::Changes::lyxMarkChange(std::ostream&, int&, lyx::Change const&, lyx::Change const&) 4.07 0.70 0.05 1471128 0.00 0.00 lyx::operator==(lyx::Change const&, lyx::Change const&) 4.07 0.75 0.05 1427808 0.00 0.00 lyx::ucs4_to_utf8(wchar_t) 3.25 0.79 0.04 1471927 0.00 0.00 lyx::Changes::lookup(int) const 3.25 0.83 0.04 1471927 0.00 0.00 lyx::Paragraph::Pimpl::lookupChange(int) const 3.25 0.87 0.04 18226 0.00 0.00 lyx::LyXLex::Pimpl::next(bool) 2.44 0.90 0.03 17 1.76 1.80 lyx::Buffer::buildMacros() 1.63 0.92 0.02 33274 0.00 0.00 lyx::LyXTabular::getCellInset(unsigned int) const 1.63 0.94 0.02 28070 0.00 0.00 lyx::ParagraphParameters::depth() const 1.63 0.96 0.02 24962 0.00 0.00 lyx::LyXLex::Pimpl::nextToken() 1.63 0.98 0.02 5680 0.00 0.00 lyx::LyXText::write(lyx::Buffer const&, std::ostream&) const 0.81 0.99 0.01 184108 0.00 0.00 lyx::Paragraph::setFont(int, lyx::LyXFont const&)
  0.81      1.00     0.01   183891     0.00     0.00  lyx::Changes::merge()
0.81 1.01 0.01 181982 0.00 0.00 lyx::Changes::insert(lyx::Change const&, int)

Reply via email to